/** * Adds local event listener. * * @param lsnr Listener. * @param evts Types of events. */ public void addListener(GridLocalEventListener lsnr, int... evts) { cctx.gridEvents().addLocalEventListener(lsnr, evts); }
/** * Removes local event listener. * * @param lsnr Local event listener. */ public void removeListener(GridLocalEventListener lsnr) { cctx.gridEvents().removeLocalEventListener(lsnr); }
/** {@inheritDoc} */ @Override public void onKernalStop() { super.onKernalStop(); stopping = true; IgniteCheckedException err = stopError(); for (GridDhtForceKeysFuture fut : forceKeyFuts.values()) fut.onDone(err); ctx.gridEvents().removeLocalEventListener(discoLsnr); }
/** {@inheritDoc} */ @Override public void start() throws IgniteCheckedException { ctx.io().addCacheHandler(ctx.cacheId(), GridCacheTtlUpdateRequest.class, new CI2<UUID, GridCacheTtlUpdateRequest>() { @Override public void apply(UUID nodeId, GridCacheTtlUpdateRequest req) { processTtlUpdateRequest(req); } }); ctx.gridEvents().addLocalEventListener(discoLsnr, EVT_NODE_LEFT, EVT_NODE_FAILED); }
/** * @param type Event type. * @return {@code True} if event is recordable. */ public boolean isRecordable(int type) { GridCacheContext cctx0 = cctx; // Event recording is impossible in recovery mode. if (cctx0 != null && cctx0.kernalContext().recoveryMode()) return false; return cctx0 != null && cctx0.userCache() && cctx0.gridEvents().isRecordable(type) && !cctx0.config().isEventsDisabled(); }
/** * Adds partition unload event. * * @param part Partition. */ public void addUnloadEvent(int part) { if (!eventRecordable(EVT_CACHE_REBALANCE_PART_UNLOADED)) LT.warn(log, "Added event without checking if event is recordable: " + U.gridEventName(EVT_CACHE_REBALANCE_PART_UNLOADED)); List<GridCacheContext> caches = this.caches; for (GridCacheContext cctx : caches) if (!cctx.config().isEventsDisabled()) cctx.gridEvents().record(new CacheRebalancingEvent(cctx.name(), cctx.localNode(), "Cache unloading event.", EVT_CACHE_REBALANCE_PART_UNLOADED, part, null, 0, 0)); }
/** * Adds rebalancing event. * * @param part Partition. * @param type Event type. * @param discoNode Discovery node. * @param discoType Discovery event type. * @param discoTs Discovery event timestamp. */ public void addRebalanceEvent(int part, int type, ClusterNode discoNode, int discoType, long discoTs) { assert discoNode != null; assert type > 0; assert discoType > 0; assert discoTs > 0; if (!eventRecordable(type)) LT.warn(log, "Added event without checking if event is recordable: " + U.gridEventName(type)); List<GridCacheContext> caches = this.caches; for (GridCacheContext cctx : caches) if (!cctx.config().isEventsDisabled() && cctx.recordEvent(type)) { cctx.gridEvents().record(new CacheRebalancingEvent(cctx.name(), cctx.localNode(), "Cache rebalancing event.", type, part, discoNode, discoType, discoTs)); } }
cctx.gridEvents().record(new CacheQueryExecutedEvent<>( cctx.localNode(), "SQL fields query executed.", cctx.gridEvents().record(new CacheQueryExecutedEvent<>( cctx.localNode(), "SPI query executed.",
cctx.gridEvents().record(new CacheQueryExecutedEvent<>( cctx.localNode(), "Scan query executed.", cctx.gridEvents().record(new CacheQueryExecutedEvent<>( cctx.localNode(), "Full text query executed.",
if (readEvt && cctx.gridEvents().hasListener(EVT_CACHE_QUERY_OBJECT_READ)) { cctx.gridEvents().record(new CacheQueryReadEvent<K, V>( cctx.localNode(), "SQL fields query result set row read.",
cctx.gridEvents().record(new CacheQueryExecutedEvent<>( locNode, "Scan query executed.",
cctx.gridEvents().hasListener(EVT_CACHE_QUERY_OBJECT_READ);
V val0 = null; if (readEvt && cctx.gridEvents().hasListener(EVT_CACHE_QUERY_OBJECT_READ)) { key0 = (K)CacheObjectUtils.unwrapBinaryIfNeeded(objCtx, key, qry.keepBinary(), false); val0 = (V)CacheObjectUtils.unwrapBinaryIfNeeded(objCtx, val, qry.keepBinary(), false); cctx.gridEvents().record(new CacheQueryReadEvent<>( cctx.localNode(), "SQL query entry read.", cctx.gridEvents().record(new CacheQueryReadEvent<>( cctx.localNode(), "Full text query entry read.",
cctx.gridEvents().record(new CacheQueryReadEvent<>( cctx.localNode(), "Scan query entry read.",
cctx.gridEvents().record(new CacheEvent(cctx.name(), cctx.localNode(), evtNode,
/** * Adds local event listener. * * @param lsnr Listener. * @param evts Types of events. */ public void addListener(GridLocalEventListener lsnr, int... evts) { cctx.gridEvents().addLocalEventListener(lsnr, evts); }
/** * Removes local event listener. * * @param lsnr Local event listener. */ public void removeListener(GridLocalEventListener lsnr) { cctx.gridEvents().removeLocalEventListener(lsnr); }
/** {@inheritDoc} */ @Override public void onKernalStop() { super.onKernalStop(); stopping = true; IgniteCheckedException err = stopError(); for (GridDhtForceKeysFuture fut : forceKeyFuts.values()) fut.onDone(err); ctx.gridEvents().removeLocalEventListener(discoLsnr); }
/** {@inheritDoc} */ @Override public void start() throws IgniteCheckedException { ctx.io().addCacheHandler(ctx.cacheId(), GridCacheTtlUpdateRequest.class, new CI2<UUID, GridCacheTtlUpdateRequest>() { @Override public void apply(UUID nodeId, GridCacheTtlUpdateRequest req) { processTtlUpdateRequest(req); } }); ctx.gridEvents().addLocalEventListener(discoLsnr, EVT_NODE_LEFT, EVT_NODE_FAILED); }
/** * @param type Event type. * @return {@code True} if event is recordable. */ public boolean isRecordable(int type) { GridCacheContext cctx0 = cctx; return cctx0 != null && cctx0.userCache() && cctx0.gridEvents().isRecordable(type) && !cctx0.config().isEventsDisabled(); }