/** * @return Grid IO manager. */ public GridIoManager gridIO() { return kernalCtx.io(); }
/** {@inheritDoc} */ @Override public void stop(boolean cancel) throws IgniteCheckedException { // Cancel update notification timer. if (updateNtfTimer != null) updateNtfTimer.cancel(); if (verChecker != null) verChecker.stop(); // Io manager can be null, if invoke stop before create io manager, for example // exception on start. if (ctx.io() != null) ctx.io().removeMessageListener(TOPIC_INTERNAL_DIAGNOSTIC); }
/** * Send IO message. * * @param nodeId Node ID. * @param msg Message. */ private void sendMessage(UUID nodeId, Message msg) throws IgniteCheckedException { ctx.io().sendToGridTopic(nodeId, TOPIC_CACHE_COORDINATOR, msg, SYSTEM_POOL); }
/** * Attempts to destroys index and release all the resources. * We use this method instead of {@link #close(Session)} because that method * is used by H2 internally. * * @param rmv Flag remove. */ public void destroy(boolean rmv) { if (msgLsnr != null) kernalContext().io().removeMessageListener(msgTopic, msgLsnr); }
/** {@inheritDoc} */ @Override protected void stop0(boolean cancel) { if (srv) cctx.kernalContext().io().removeMessageListener(TOPIC_WAL, ioLsnr); }
@Override public void addLocalMessageListener(Object topic, IgniteBiPredicate<UUID, ?> p) { A.notNull(topic, "topic"); A.notNull(p, "p"); ctx.io().addUserMessageListener(topic, p); }
@Override public void addMessageListener(GridMessageListener lsnr, String topic) { A.notNull(lsnr, "lsnr"); A.notNull(topic, "topic"); ctx.io().addMessageListener(topic, lsnr); }
/** {@inheritDoc} */ @Override public void stopLocalListen(@Nullable Object topic, IgniteBiPredicate<UUID, ?> p) { A.notNull(p, "p"); guard(); try { ctx.io().removeUserMessageListener(topic, p); } finally { unguard(); } }
@Override public void removeLocalMessageListener(Object topic, IgniteBiPredicate<UUID, ?> p) { A.notNull(topic, "topic"); A.notNull(topic, "p"); ctx.io().removeUserMessageListener(topic, p); }
/** {@inheritDoc} */ @Override public void localListen(@Nullable Object topic, IgniteBiPredicate<UUID, ?> p) { A.notNull(p, "p"); guard(); try { ctx.io().addUserMessageListener(topic, p); } finally { unguard(); } }
/** * Starts deployment communication. */ void start() { ctx.io().addMessageListener(TOPIC_CLASSLOAD, peerLsnr); if (log.isDebugEnabled()) log.debug("Started deployment communication."); }
/** * @param nodeId Node ID to send message to. * @param msg Message to send. * @throws IgniteCheckedException If send failed. */ private void send0(UUID nodeId, Object msg) throws IgniteCheckedException { ClusterNode node = ctx.kernalContext().discovery().node(nodeId); if (msg instanceof Message) ctx.kernalContext().io().sendToGridTopic(node, GridTopic.TOPIC_HADOOP_MSG, (Message)msg, GridIoPolicy.PUBLIC_POOL); else ctx.kernalContext().io().sendUserMessage(F.asList(node), msg, GridTopic.TOPIC_HADOOP, false, 0, false); }
/** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { synchronized (genEcnKeyMux) { stopped = true; if (ioLsnr != null) ctx.io().removeMessageListener(TOPIC_GEN_ENC_KEY, ioLsnr); if (discoLsnr != null) ctx.event().removeDiscoveryEventListener(discoLsnr, EVT_NODE_LEFT, EVT_NODE_FAILED); cancelFutures("Kernal stopped."); } }
/** {@inheritDoc} */ @Override public void stop(boolean cancel) throws IgniteCheckedException { if (ctx.config().isDaemon()) return; ctx.io().removeMessageListener(TOPIC_CONTINUOUS); for (IgniteThread thread : bufCheckThreads.values()) { U.interrupt(thread); U.join(thread); } if (log.isDebugEnabled()) log.debug("Continuous processor stopped."); }
/** {@inheritDoc} */ @Override public void onBeforeJobResponseSent(GridJobWorker worker) { if (log.isDebugEnabled()) log.debug("Received onBeforeJobResponseSent() callback: " + worker); assert jobAlwaysActivate || !passiveJobs.containsKey(worker.getJobId()); if (worker.getSession().isFullSupport()) { // Unregister session request listener for this jobs. ctx.io().removeMessageListener(worker.getJobTopic()); } }
/** {@inheritDoc} */ @Override public void stop(boolean cancel) throws IgniteCheckedException { if (!isEnabled) return; ctx.io().removeMessageListener(GridTopic.TOPIC_AUTH, ioLsnr); ctx.event().removeDiscoveryEventListener(discoLsnr, DISCO_EVT_TYPES); cancelFutures("Node stopped"); if (!cancel) exec.shutdown(); else exec.shutdownNow(); }
@Override public void apply(IgniteInternalFuture<Void> future) { try { if (node.isLocal()) h2.reduceQueryExecutor().onMessage(ctx.localNodeId(), msg); else ctx.io().sendToGridTopic(node, GridTopic.TOPIC_QUERY, msg, QUERY_POOL); } catch (Exception e) { U.error(log, e); } } });
/** {@inheritDoc} */ @Override public void resetMetrics() { guard(); try { ctx.jobMetric().reset(); ctx.io().resetMetrics(); ctx.task().resetMetrics(); } finally { unguard(); } }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { ((IgniteKernal)grid()).context().io(). removeMessageListener(GridTopic.TOPIC_COMM_USER.name()); }
/** * Constructor. */ protected FragmentizerCoordinator() { super(igfsCtx.kernalContext().igniteInstanceName(), "fragmentizer-coordinator", igfsCtx.kernalContext().log(IgfsFragmentizerManager.class)); igfsCtx.kernalContext().event().addLocalEventListener(this, EVT_NODE_LEFT, EVT_NODE_FAILED); igfsCtx.kernalContext().io().addMessageListener(topic, this); }