Interface CommunicationSpi<T extends Serializable>
- 
- All Superinterfaces:
- IgniteSpi
 - All Known Implementing Classes:
- org.apache.ignite.spi.communication.tcp.internal.TcpCommunicationConfigInitializer,- TcpCommunicationSpi
 
 public interface CommunicationSpi<T extends Serializable> extends IgniteSpi Communication SPI is responsible for data exchange between nodes.Communication SPI is one of the most important SPI in Ignite. It is used heavily throughout the system and provides means for all data exchanges between nodes, such as internal implementation details and user driven messages. Functionality to this SPI is exposed directly in Igniteinterface:Ignite comes with built-in communication SPI implementations: NOTE: this SPI (i.e. methods in this interface) should never be used directly. SPIs provide internal view on the subsystem and is used internally by Ignite kernal. In rare use cases when access to a specific implementation of this SPI is required - an instance of this SPI can be obtained viaIgnite.configuration()method to check its configuration properties or call other non-SPI methods. Note again that calling methods from this interface on the obtained instance can lead to undefined behavior and explicitly not supported.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetOutboundMessagesQueueSize()Gets outbound messages queue size.longgetReceivedBytesCount()Gets received bytes count.intgetReceivedMessagesCount()Gets received messages count.longgetSentBytesCount()Gets sent bytes count.intgetSentMessagesCount()Gets sent messages count.voidresetMetrics()Resets metrics for this SPI instance.voidsendMessage(ClusterNode destNode, T msg)Sends given message to destination node.voidsetListener(@Nullable CommunicationListener<T> lsnr)Set communication listener.- 
Methods inherited from interface org.apache.ignite.spi.IgniteSpigetName, getNodeAttributes, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextInitialized, spiStart, spiStop
 
- 
 
- 
- 
- 
Method Detail- 
sendMessagevoid sendMessage(ClusterNode destNode, T msg) throws IgniteSpiException Sends given message to destination node. Note that characteristics of the exchange such as durability, guaranteed delivery or error notification is dependant on SPI implementation.- Parameters:
- destNode- Destination node.
- msg- Message to send.
- Throws:
- IgniteSpiException- Thrown in case of any error during sending the message. Note that this is not guaranteed that failed communication will result in thrown exception as this is dependant on SPI implementation.
 
 - 
getSentMessagesCountint getSentMessagesCount() Gets sent messages count.- Returns:
- Sent messages count.
 
 - 
getSentBytesCountlong getSentBytesCount() Gets sent bytes count.- Returns:
- Sent bytes count.
 
 - 
getReceivedMessagesCountint getReceivedMessagesCount() Gets received messages count.- Returns:
- Received messages count.
 
 - 
getReceivedBytesCountlong getReceivedBytesCount() Gets received bytes count.- Returns:
- Received bytes count.
 
 - 
getOutboundMessagesQueueSizeint getOutboundMessagesQueueSize() Gets outbound messages queue size.- Returns:
- Outbound messages queue size.
 
 - 
resetMetricsvoid resetMetrics() Resets metrics for this SPI instance.
 - 
setListenervoid setListener(@Nullable @Nullable CommunicationListener<T> lsnr)Set communication listener.- Parameters:
- lsnr- Listener to set or- nullto unset the listener.
 
 
- 
 
-