/** * Checks if it is a p2p deployment message. * * @param msg Message to check. * @return {@code True} if this is a p2p message. */ private boolean isDeploymentMessage(GridIoMessage msg) { Object origMsg = msg.message(); boolean dep = (origMsg instanceof GridDeploymentRequest) || (origMsg instanceof GridDeploymentResponse); if (dep) info(">>> Got deployment message: " + origMsg); return dep; } }
assert msg != null; long timeout = msg.timeout(); boolean skipOnTimeout = msg.skipOnTimeout(); map = msgSetMap.get(msg.topic()); set = new GridCommunicationMessageSet(plc, msg.topic(), nodeId, timeout, skipOnTimeout, msg, msgC); msg.topic(), map); set = new GridCommunicationMessageSet(plc, msg.topic(), nodeId, timeout, skipOnTimeout, msg, msgC)); msgSetMap.remove(msg.topic(), map); else { assert set != null; msgSetMap.remove(msg.topic(), map); final GridMessageListener lsnr = listenerGet0(msg.topic()); if (closedTopics.contains(msg.topic())) { if (log.isDebugEnabled()) log.debug("Message is ignored as it came for the closed topic: " + msg); msgSetMap.remove(msg.topic(), map);
if (msg.topicOrdinal() == TOPIC_IO_TEST.ordinal()) { IgniteIoTestMessage msg0 = (IgniteIoTestMessage)msg.message(); if (msg.topicOrdinal() == TOPIC_CACHE_COORDINATOR.ordinal()) { MvccMessage msg0 = (MvccMessage)msg.message(); if (plc == GridIoPolicy.SYSTEM_POOL && msg.partition() != GridIoMessage.STRIPE_DISABLED_PART) { ctx.getStripedExecutorService().execute(msg.partition(), c); if (plc == GridIoPolicy.DATA_STREAMER_POOL && msg.partition() != GridIoMessage.STRIPE_DISABLED_PART) { ctx.getDataStreamerExecutorService().execute(msg.partition(), c); if (msg.topicOrdinal() == TOPIC_IO_TEST.ordinal()) { IgniteIoTestMessage msg0 = (IgniteIoTestMessage)msg.message(); String execName = msg.executorName();
/** * @param msg Message. * @param nodeId Node ID. */ private void processRegularMessage0(GridIoMessage msg, UUID nodeId) { GridMessageListener lsnr = listenerGet0(msg.topic()); if (lsnr == null) return; Object obj = msg.message(); assert obj != null; invokeListener(msg.policy(), lsnr, nodeId, obj); }
GridIoMessage ioMsg = (GridIoMessage)msg; Message appMsg = ioMsg.message(); -1); msg = new GridIoMessage( GridTestUtils.<Byte>getFieldValue(ioMsg, "plc"), GridTestUtils.getFieldValue(ioMsg, "topic"), appMsg, GridTestUtils.<Boolean>getFieldValue(ioMsg, "ordered"), ioMsg.timeout(), ioMsg.skipOnTimeout());
assert topicOrd >= 0 || !(topic instanceof GridTopic) : msg; GridIoMessage ioMsg = new GridIoMessage(plc, topic, topicOrd, msg, ordered, timeout, skipOnTimeout); ioMsg.topicBytes(U.marshal(marsh, topic));
if (!writer.writeHeader(directType(), fieldsCount())) return false;
msg = new GridIoMessage();
@Override public void run() { try { threadProcessingMessage(true, msgC); GridMessageListener lsnr = listenerGet0(msg.topic()); if (lsnr == null) return; Object obj = msg.message(); assert obj != null; invokeListener(msg.policy(), lsnr, nodeId, obj); } finally { threadProcessingMessage(false, null); msgC.run(); } } };
assert topicOrd >= 0 || !(topic instanceof GridTopic) : msg; GridIoMessage ioMsg = new GridIoMessage(plc, topic, topicOrd, msg, ordered, timeout, skipOnTimeout); ioMsg.topicBytes(U.marshal(marsh, topic));
if (!writer.writeHeader(directType(), fieldsCount())) return false;
msg = new GridIoMessage();
/** * Collects statistics for message sent by SPI. * * @param msg Sent message. * @param nodeId Receiver node id. */ public void onMessageSent(Message msg, UUID nodeId) { assert msg != null; assert nodeId != null; if (msg instanceof GridIoMessage) { msg = ((GridIoMessage) msg).message(); updateMessageTypeMap(msg); ThreadMetrics metrics = threadMetrics.get(); metrics.onMessageSent(msg, nodeId); } }
/** * @param msg Message. * @param nodeId Node ID. */ @SuppressWarnings("deprecation") private void processRegularMessage0(GridIoMessage msg, UUID nodeId) { GridMessageListener lsnr = listenerGet0(msg.topic()); if (lsnr == null) return; Object obj = msg.message(); assert obj != null; invokeListener(msg.policy(), lsnr, nodeId, obj); }
if (msg.topicOrdinal() == TOPIC_IO_TEST.ordinal()) { IgniteIoTestMessage msg0 = (IgniteIoTestMessage)msg.message(); if (msg.topicOrdinal() == TOPIC_CACHE_COORDINATOR.ordinal()) { MvccMessage msg0 = (MvccMessage)msg.message(); if (plc == GridIoPolicy.SYSTEM_POOL && msg.partition() != GridIoMessage.STRIPE_DISABLED_PART) { ctx.getStripedExecutorService().execute(msg.partition(), c); if (plc == GridIoPolicy.DATA_STREAMER_POOL && msg.partition() != GridIoMessage.STRIPE_DISABLED_PART) { ctx.getDataStreamerExecutorService().execute(msg.partition(), c); if (msg.topicOrdinal() == TOPIC_IO_TEST.ordinal()) { IgniteIoTestMessage msg0 = (IgniteIoTestMessage)msg.message(); String execName = msg.executorName();
assert msg != null; long timeout = msg.timeout(); boolean skipOnTimeout = msg.skipOnTimeout(); map = msgSetMap.get(msg.topic()); set = new GridCommunicationMessageSet(plc, msg.topic(), nodeId, timeout, skipOnTimeout, msg, msgC); msg.topic(), map); set = new GridCommunicationMessageSet(plc, msg.topic(), nodeId, timeout, skipOnTimeout, msg, msgC)); msgSetMap.remove(msg.topic(), map); else { assert set != null; msgSetMap.remove(msg.topic(), map); final GridMessageListener lsnr = listenerGet0(msg.topic()); if (closedTopics.contains(msg.topic())) { if (log.isDebugEnabled()) log.debug("Message is ignored as it came for the closed topic: " + msg); msgSetMap.remove(msg.topic(), map);
/** * Collects statistics for message received by SPI. * * @param msg Received message. * @param nodeId Sender node id. */ public void onMessageReceived(Message msg, UUID nodeId) { assert msg != null; assert nodeId != null; if (msg instanceof GridIoMessage) { msg = ((GridIoMessage) msg).message(); updateMessageTypeMap(msg); ThreadMetrics metrics = threadMetrics.get(); metrics.onMessageReceived(msg, nodeId); } }
@Override public void run() { try { threadProcessingMessage(true, msgC); GridMessageListener lsnr = listenerGet0(msg.topic()); if (lsnr == null) return; Object obj = msg.message(); assert obj != null; invokeListener(msg.policy(), lsnr, nodeId, obj); } finally { threadProcessingMessage(false, null); msgC.run(); } } };
/** * Checks if message should be ignored. * * @param msg Message. * @return {@code True} if message should be ignored. */ private boolean ignoredMessage(GridIoMessage msg) { return ignoreMsgCls != null && ignoreMsgCls.isAssignableFrom(msg.message().getClass()); } }
/** * @param lsnr Listener to notify. */ void unwind(GridMessageListener lsnr) { assert reserved.get(); for (GridTuple3<GridIoMessage, Long, IgniteRunnable> t = msgs.poll(); t != null; t = msgs.poll()) { try { invokeListener(plc, lsnr, nodeId, t.get1().message()); } finally { if (t.get3() != null) t.get3().run(); } } }