public interface TransmissionHandler
GridIoManager prior to opening a new transmission connection
to this topic.
NOTE: Only one such handler per registered topic is allowed for the communication manager. Only one thread is allowed for data processing within a single topic.
Files from the remote node can be handled of two different ways within a single established connection.
It is up to the sender to decide how the particular file must be processed by the remote node. The
TransmissionPolicy is used for such purpose. If TransmissionPolicy.FILE type is received by
remote node the #fileHandler() will be picked up to process this file, the otherwise for the
TransmissionPolicy.CHUNK the #chunkHandler() will be picked up.
| Modifier and Type | Method and Description |
|---|---|
Consumer<ByteBuffer> |
chunkHandler(UUID nodeId,
TransmissionMeta initMeta)
Chunk handler represents by itself the way of input data stream processing.
|
Consumer<File> |
fileHandler(UUID nodeId,
TransmissionMeta initMeta)
File handler represents by itself the way of input data stream processing.
|
String |
filePath(UUID nodeId,
TransmissionMeta fileMeta)
Absolute path of a file to receive remote transmission data into.
|
void |
onEnd(UUID rmtNodeId)
The end of the handled transmission.
|
void |
onException(UUID nodeId,
Throwable err) |
Consumer<ByteBuffer> chunkHandler(UUID nodeId, TransmissionMeta initMeta)
ByteBuffer with data from input for further processing.
Activated when the TransmissionPolicy.CHUNK policy sent.
The TransmissionCancelledException can be thrown to gracefully interrupt the local transmission and
the node-senders transmission session.
nodeId - Remote node id from which request has been received.initMeta - Initial handler meta info.String filePath(UUID nodeId, TransmissionMeta fileMeta)
TransmissionCancelledException
can be thrown if it is necessary to gracefully interrupt current transmission session on the node-sender.nodeId - Remote node id from which request has been received.fileMeta - File meta info.Consumer<File> fileHandler(UUID nodeId, TransmissionMeta initMeta)
TransmissionPolicy.FILE policy sent.
The TransmissionCancelledException can be thrown to gracefully interrupt the local transmission and
the node-senders transmission session.
nodeId - Remote node id from which request has been received.initMeta - Initial handler meta info.FileChannel manner.void onException(UUID nodeId, Throwable err)
nodeId - Remote node id on which the error occurred.err - The err of fail handling process.void onEnd(UUID rmtNodeId)
rmtNodeId - Remote node id from which the source request comes from.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021