public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializable>>
GridComponent.DiscoveryDataExchangeType| Modifier and Type | Field and Description |
|---|---|
static byte |
DIRECT_PROTO_VER
Direct protocol version.
|
static String |
DIRECT_PROTO_VER_ATTR
Direct protocol version attribute name.
|
static MessageFactory[] |
EMPTY
Empty array of message factories.
|
static int |
MAX_CLOSED_TOPICS
Max closed topics to store.
|
ctx, log| Constructor and Description |
|---|
GridIoManager(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDisconnectListener(GridDisconnectListener lsnr) |
void |
addMessageListener(GridTopic topic,
GridMessageListener lsnr) |
void |
addMessageListener(Object topic,
GridMessageListener lsnr) |
void |
addUserMessageListener(Object topic,
IgniteBiPredicate<UUID,?> p) |
boolean |
checkNodeLeft(UUID nodeId,
IgniteCheckedException sndErr,
boolean ping) |
static Byte |
currentPolicy() |
void |
dumpStats()
Dumps SPI stats to diagnostic logs in case TcpCommunicationSpi is used, no-op otherwise.
|
MessageFormatter |
formatter() |
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.
|
MessageFactory |
messageFactory() |
void |
onKernalStart0() |
void |
onKernalStop0(boolean cancel) |
void |
printMemoryStats()
Prints memory statistics (sizes of internal structures, etc.).
|
void |
removeDisconnectListener(GridDisconnectListener lsnr) |
boolean |
removeMessageListener(GridTopic topic) |
boolean |
removeMessageListener(GridTopic topic,
GridMessageListener lsnr) |
boolean |
removeMessageListener(Object topic) |
boolean |
removeMessageListener(Object topic,
GridMessageListener lsnr) |
void |
removeUserMessageListener(Object topic,
IgniteBiPredicate<UUID,?> p) |
void |
resetMetrics()
Resets metrics for this manager.
|
void |
runIoTest(long warmup,
long duration,
int threads,
long latencyLimit,
int rangesCnt,
int payLoadSize,
boolean procFromNioThread,
List<ClusterNode> nodes) |
void |
sendGeneric(ClusterNode node,
Object topic,
int topicOrd,
Message msg,
byte plc) |
IgniteInternalFuture<List<IgniteIoTestMessage>> |
sendIoTest(ClusterNode node,
byte[] payload,
boolean procFromNioThread) |
IgniteInternalFuture |
sendIoTest(List<ClusterNode> nodes,
byte[] payload,
boolean procFromNioThread) |
void |
sendOrderedMessage(ClusterNode node,
Object topic,
Message msg,
byte plc,
long timeout,
boolean skipOnTimeout) |
void |
sendOrderedMessage(ClusterNode node,
Object topic,
Message msg,
byte plc,
long timeout,
boolean skipOnTimeout,
IgniteInClosure<IgniteException> ackC) |
void |
sendToCustomTopic(ClusterNode node,
Object topic,
Message msg,
byte plc) |
void |
sendToCustomTopic(UUID nodeId,
Object topic,
Message msg,
byte plc) |
void |
sendToGridTopic(ClusterNode node,
GridTopic topic,
Message msg,
byte plc) |
void |
sendToGridTopic(ClusterNode node,
GridTopic topic,
Message msg,
byte plc,
IgniteInClosure<IgniteException> ackC) |
void |
sendToGridTopic(Collection<? extends ClusterNode> nodes,
GridTopic topic,
Message msg,
byte plc) |
void |
sendToGridTopic(UUID nodeId,
GridTopic topic,
Message msg,
byte plc) |
void |
sendUserMessage(Collection<? extends ClusterNode> nodes,
Object msg,
Object topic,
boolean ordered,
long timeout,
boolean async)
Sends a peer deployable user message.
|
void |
start()
Starts grid component.
|
void |
stop(boolean cancel)
Stops grid component.
|
assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, enabled, getSpi, getSpi, getSpis, inject, onAfterSpiStart, onBeforeSpiStart, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onKernalStop, onReconnected, startInfo, startSpi, stopInfo, stopSpi, toString, validateNode, validateNodepublic static final MessageFactory[] EMPTY
public static final int MAX_CLOSED_TOPICS
public static final String DIRECT_PROTO_VER_ATTR
public static final byte DIRECT_PROTO_VER
public GridIoManager(GridKernalContext ctx)
ctx - Grid kernal context.public MessageFactory messageFactory()
public MessageFormatter formatter()
public void resetMetrics()
public void start()
throws IgniteCheckedException
IgniteCheckedException - Throws in case of any errors.public IgniteInternalFuture sendIoTest(List<ClusterNode> nodes, byte[] payload, boolean procFromNioThread)
nodes - Nodes.payload - Payload.procFromNioThread - If true message is processed from NIO thread.public IgniteInternalFuture<List<IgniteIoTestMessage>> sendIoTest(ClusterNode node, byte[] payload, boolean procFromNioThread)
node - Node.payload - Payload.procFromNioThread - If true message is processed from NIO thread.public void runIoTest(long warmup,
long duration,
int threads,
long latencyLimit,
int rangesCnt,
int payLoadSize,
boolean procFromNioThread,
List<ClusterNode> nodes)
warmup - Warmup duration in milliseconds.duration - Test duration in milliseconds.threads - Thread count.latencyLimit - Max latency in nanoseconds.rangesCnt - Ranges count in resulting histogram.payLoadSize - Payload size in bytes.procFromNioThread - True to process requests in NIO threads.nodes - Nodes participating in test.public void onKernalStart0()
throws IgniteCheckedException
onKernalStart0 in class GridManagerAdapter<CommunicationSpi<Serializable>>IgniteCheckedException - If failed.public void onKernalStop0(boolean cancel)
onKernalStop0 in class GridManagerAdapter<CommunicationSpi<Serializable>>cancel - Cancel flag.public void stop(boolean cancel)
throws IgniteCheckedException
cancel - If true, then all ongoing tasks or jobs for relevant
components need to be cancelled.IgniteCheckedException - Thrown in case of any errors.@Nullable public static Byte currentPolicy()
public boolean checkNodeLeft(UUID nodeId, IgniteCheckedException sndErr, boolean ping) throws IgniteClientDisconnectedCheckedException
nodeId - Node ID.sndErr - Send error.ping - True if try ping node.True if node left.IgniteClientDisconnectedCheckedException - If ping failed.public void sendToCustomTopic(UUID nodeId, Object topic, Message msg, byte plc) throws IgniteCheckedException
nodeId - Id of destination node.topic - Topic to send the message to.msg - Message to send.plc - Type of processing.IgniteCheckedException - Thrown in case of any errors.public void sendToGridTopic(UUID nodeId, GridTopic topic, Message msg, byte plc) throws IgniteCheckedException
nodeId - Id of destination node.topic - Topic to send the message to.msg - Message to send.plc - Type of processing.IgniteCheckedException - Thrown in case of any errors.public void sendToCustomTopic(ClusterNode node, Object topic, Message msg, byte plc) throws IgniteCheckedException
node - Destination node.topic - Topic to send the message to.msg - Message to send.plc - Type of processing.IgniteCheckedException - Thrown in case of any errors.public void sendToGridTopic(ClusterNode node, GridTopic topic, Message msg, byte plc) throws IgniteCheckedException
node - Destination node.topic - Topic to send the message to.msg - Message to send.plc - Type of processing.IgniteCheckedException - Thrown in case of any errors.public void sendGeneric(ClusterNode node, Object topic, int topicOrd, Message msg, byte plc) throws IgniteCheckedException
node - Destination node.topic - Topic to send the message to.topicOrd - GridTopic enumeration ordinal.msg - Message to send.plc - Type of processing.IgniteCheckedException - Thrown in case of any errors.public void sendOrderedMessage(ClusterNode node, Object topic, Message msg, byte plc, long timeout, boolean skipOnTimeout) throws IgniteCheckedException
node - Destination node.topic - Topic to send the message to.msg - Message to send.plc - Type of processing.timeout - Timeout to keep a message on receiving queue.skipOnTimeout - Whether message can be skipped on timeout.IgniteCheckedException - Thrown in case of any errors.public void sendToGridTopic(ClusterNode node, GridTopic topic, Message msg, byte plc, IgniteInClosure<IgniteException> ackC) throws IgniteCheckedException
node - Destination nodes.topic - Topic to send the message to.msg - Message to send.plc - Type of processing.ackC - Ack closure.IgniteCheckedException - Thrown in case of any errors.public void sendToGridTopic(Collection<? extends ClusterNode> nodes, GridTopic topic, Message msg, byte plc) throws IgniteCheckedException
nodes - Destination nodes.topic - Topic to send the message to.msg - Message to send.plc - Type of processing.IgniteCheckedException - Thrown in case of any errors.public void sendOrderedMessage(ClusterNode node, Object topic, Message msg, byte plc, long timeout, boolean skipOnTimeout, IgniteInClosure<IgniteException> ackC) throws IgniteCheckedException
node - Destination node.topic - Topic to send the message to.msg - Message to send.plc - Type of processing.timeout - Timeout to keep a message on receiving queue.skipOnTimeout - Whether message can be skipped on timeout.ackC - Ack closure.IgniteCheckedException - Thrown in case of any errors.public void sendUserMessage(Collection<? extends ClusterNode> nodes, Object msg, @Nullable Object topic, boolean ordered, long timeout, boolean async) throws IgniteCheckedException
nodes - Destination nodes.msg - Message to send.topic - Message topic to use.ordered - Is message ordered?timeout - Message timeout in milliseconds for ordered messages.async - Async flag.IgniteCheckedException - Thrown in case of any errors.public void addUserMessageListener(@Nullable
Object topic,
@Nullable
IgniteBiPredicate<UUID,?> p)
topic - Topic to subscribe to.p - Message predicate.public void removeUserMessageListener(@Nullable
Object topic,
IgniteBiPredicate<UUID,?> p)
topic - Topic to unsubscribe from.p - Message predicate.public void addMessageListener(GridTopic topic, GridMessageListener lsnr)
topic - Listener's topic.lsnr - Listener to add.public void addDisconnectListener(GridDisconnectListener lsnr)
lsnr - Listener to add.public void removeDisconnectListener(GridDisconnectListener lsnr)
lsnr - Listener to remove.public void addMessageListener(Object topic, GridMessageListener lsnr)
topic - Listener's topic.lsnr - Listener to add.public boolean removeMessageListener(GridTopic topic)
topic - Message topic.public boolean removeMessageListener(Object topic)
topic - Message topic.public boolean removeMessageListener(GridTopic topic, @Nullable GridMessageListener lsnr)
topic - Listener's topic.lsnr - Listener to remove.public boolean removeMessageListener(Object topic, @Nullable GridMessageListener lsnr)
topic - Listener's topic.lsnr - Listener to remove.public int getSentMessagesCount()
public long getSentBytesCount()
public int getReceivedMessagesCount()
public long getReceivedBytesCount()
public int getOutboundMessagesQueueSize()
public void dumpStats()
public void printMemoryStats()
printMemoryStats in interface GridComponentprintMemoryStats in class GridManagerAdapter<CommunicationSpi<Serializable>>
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018