...
Partition preloader must support The node partition preloader machinery download cache partition file relocation files from one cluster node to another cluster nodes which owns desired partitions (the zero copy algorithm [1] assume to be used by default). To achieve this, the file transfer machinery transmission process must be implemented at Apache Ignite over Communication SPI.
Ignite's IThe Comminication SPI must support to:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
public interface CommunicationListenerEx<T extends Serializable> extends EventListener { /** * @param nodeId Remote node id. * @param initMsg Init channel message. * @param channel Locally created channel endpoint. */ public void onChannelOpened(UUID nodeId, Message initMsg, Channel channel); } |
The file transmission IO manager must support to:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
public interface TransmissionHandler { /** * @param err The err of fail handling process. */ public void onException(UUID nodeId, Throwable err); /** * @param nodeId Remote node id from which request has been received. * @param fileMeta File meta info. * @return Absolute pathname denoting a file. */ public String filePath(UUID nodeId, TransmissionMeta fileMeta); /** * <em>Chunk handler</em> represents by itself the way of input data stream processing. * It accepts within each chunk a {@link ByteBuffer} with data from input for further processing. * * @param nodeId Remote node id from which request has been received. * @param initMeta Initial handler meta info. * @return Instance of chunk handler to process incoming data by chunks. */ public Consumer<ByteBuffer> chunkHandler(UUID nodeId, TransmissionMeta initMeta); /** * <em>File handler</em> represents by itself the way of input data stream processing. All the data will * be processed under the hood using zero-copy transferring algorithm and only start file processing and * the end of processing will be provided. * * @param nodeId Remote node id from which request has been received. * @param initMeta Initial handler meta info. * @return Intance of read handler to process incoming data like the {@link FileChannel} manner. */ public Consumer<File> fileHandler(UUID nodeId, TransmissionMeta initMeta); } |
...