/** * @return Grid event storage manager. */ public GridEventStorageManager gridEvents() { return ctx.event(); }
/** {@inheritDoc} */ @Override public void unregister(UUID routineId, GridKernalContext ctx) { assert routineId != null; assert ctx != null; if (lsnr != null) ctx.event().removeLocalEventListener(lsnr, types); }
/** {@inheritDoc} */ @Override public boolean isEnabled(int type) { if (type < 0) throw new IllegalArgumentException("Invalid event type: " + type); return ctx.event().isUserRecordable(type); }
/** {@inheritDoc} */ @Override public void onKernalStop() { if (discoLsnr != null) { ctx.event().removeLocalEventListener(discoLsnr); if (log.isDebugEnabled()) log.debug("Unregistered deployment discovery listener: " + discoLsnr); } }
/** {@inheritDoc} */ @Override public void onKernalStop() { if (discoLsnr != null) { ctx.event().removeLocalEventListener(discoLsnr); if (log.isDebugEnabled()) log.debug("Unregistered deployment discovery listener: " + discoLsnr); } }
/** {@inheritDoc} */ @Override public boolean stopLocalListen(GridPredicate<? extends GridEvent> lsnr, @Nullable int... types) { A.notNull(lsnr, "lsnr"); guard(); try { return ctx.event().removeLocalEventListener(lsnr, types); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public void onTimeout() { if (finishing.get()) return; timedOut = true; U.warn(log, "Job has timed out: " + ses); cancel(); if (!internal && ctx.event().isRecordable(EVT_JOB_TIMEDOUT)) recordEvent(EVT_JOB_TIMEDOUT, "Job has timed out: " + job); }
/** {@inheritDoc} */ @Override public <T extends GridEvent> Collection<T> localQuery(GridPredicate<T> p, @Nullable int... types) { A.notNull(p, "p"); guard(); try { return ctx.event().localEvents(compoundPredicate(p, types)); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public void enableLocal(int[] types) { A.notEmpty(types, "types"); guard(); try { ctx.event().enableEvents(types); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public void disableLocal(int[] types) { A.notEmpty(types, "types"); guard(); try { ctx.event().disableEvents(types); } finally { unguard(); } }
/** Initializes future. */ private void init() { ctx.event().addLocalEventListener(this, EVT_NODE_JOINED, EVT_NODE_LEFT, EVT_NODE_FAILED); // Close potential window. long topVer = ctx.discovery().topologyVersion(); if (topVer >= awaitVer) onDone(topVer); }
/** {@inheritDoc} */ @Override public boolean allEventsUserRecordable(int[] types) { A.notNull(types, "types"); guard(); try { return ctx.event().isAllUserRecordable(types); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public <T extends GridEvent> GridFuture<List<T>> remoteQuery(GridPredicate<T> p, long timeout, @Nullable int... types) { A.notNull(p, "p"); guard(); try { return ctx.event().remoteEventsAsync(compoundPredicate(p, types), prj.nodes(), timeout); } finally { unguard(); } }
/** {@inheritDoc} */ @Override protected void body() { assert job != null; startTime = U.currentTimeMillis(); isStarted = true; // Event notification. evtLsnr.onJobStarted(this); if (!internal && ctx.event().isRecordable(EVT_JOB_STARTED)) recordEvent(EVT_JOB_STARTED, /*no message for success*/null); execute0(true); }
/** {@inheritDoc} */ @Override public void localListen(GridPredicate<? extends GridEvent> lsnr, int[] types) { A.notNull(lsnr, "lsnr"); A.notEmpty(types, "types"); guard(); try { ctx.event().addLocalEventListener(lsnr, types); } finally { unguard(); } }
/** * Constructor. */ protected FragmentizerCoordinator() { super(ggfsCtx.kernalContext().gridName(), "fragmentizer-coordinator", ggfsCtx.kernalContext().log()); ggfsCtx.kernalContext().event().addLocalEventListener(this, EVT_NODE_LEFT, EVT_NODE_FAILED); ggfsCtx.kernalContext().io().addMessageListener(topic, this); }
/** * Constructor. */ protected FragmentizerCoordinator() { super(ggfsCtx.kernalContext().gridName(), "fragmentizer-coordinator", ggfsCtx.kernalContext().log()); ggfsCtx.kernalContext().event().addLocalEventListener(this, EVT_NODE_LEFT, EVT_NODE_FAILED); ggfsCtx.kernalContext().io().addMessageListener(topic, this); }
/** {@inheritDoc} */ @Override public void start() { ctx.event().addLocalEventListener(discoLsnr, EVT_NODE_FAILED, EVT_NODE_LEFT); ctx.io().addMessageListener(TOPIC_JOB_SIBLINGS, new JobSiblingsMessageListener()); ctx.io().addMessageListener(TOPIC_TASK_CANCEL, new TaskCancelMessageListener()); ctx.io().addMessageListener(TOPIC_TASK, new JobMessageListener(true)); if (log.isDebugEnabled()) log.debug("Started task processor."); }