public interface GridCommunicationSpi<T extends Serializable> extends GridSpi
Communication SPI is one of the most important SPI in GridGain. 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 Grid interface:
GridGain 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 GridGain kernal. In rare use cases when access to a specific implementation of this SPI is required - an instance of this SPI can be obtained viaGrid.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.| Modifier and Type | Method and Description |
|---|---|
int |
getOutboundMessagesQueueSize()
Gets outbound messages queue size.
|
long |
getReceivedBytesCount()
Gets received bytes count.
|
int |
getReceivedMessagesCount()
Gets received messages count.
|
long |
getSentBytesCount()
Gets sent bytes count.
|
int |
getSentMessagesCount()
Gets sent messages count.
|
void |
resetMetrics()
Resets metrics for this SPI instance.
|
void |
sendMessage(GridNode destNode,
T msg)
Sends given message to destination node.
|
void |
setListener(GridCommunicationListener<T> lsnr)
Set communication listener.
|
getName, getNodeAttributes, onContextDestroyed, onContextInitialized, spiStart, spiStopvoid sendMessage(GridNode destNode, T msg) throws GridSpiException
destNode - Destination node.msg - Message to send.GridSpiException - 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.int getSentMessagesCount()
long getSentBytesCount()
int getReceivedMessagesCount()
long getReceivedBytesCount()
int getOutboundMessagesQueueSize()
void resetMetrics()
void setListener(@Nullable GridCommunicationListener<T> lsnr)
lsnr - Listener to set or null to unset the listener.Copyright © 2014. All rights reserved.