/** {@inheritDoc} */ @Override protected void start0() throws IgniteCheckedException { dhtCtx = cctx.isNear() ? cctx.near().dht().context() : cctx; boolean cleanupDisabled = cctx.kernalContext().isDaemon() || !cctx.config().isEagerTtl() || CU.isUtilityCache(cctx.name()) || cctx.dataStructuresCache() || (cctx.kernalContext().clientNode() && cctx.config().getNearConfiguration() == null); if (cleanupDisabled) return; eagerTtlEnabled = true; cctx.shared().ttl().register(this); pendingEntries = (!cctx.isLocal() && cctx.config().getNearConfiguration() != null) ? new GridConcurrentSkipListSetEx() : null; }
/** * Adds tracked entry to ttl processor. * * @param entry Entry to add. */ void addTrackedEntry(GridNearCacheEntry entry) { assert entry.lockedByCurrentThread(); EntryWrapper e = new EntryWrapper(entry); pendingEntries.add(e); }
/** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { if (pendingEntries != null) pendingEntries.clear(); cctx.shared().ttl().unregister(this); }
/** * @return The size of pending entries. * @throws IgniteCheckedException If failed. */ public long pendingSize() throws IgniteCheckedException { return (pendingEntries != null ? pendingEntries.sizex() : 0) + cctx.offheap().expiredSize(); }
/** * @param entry Entry to remove. */ void removeTrackedEntry(GridNearCacheEntry entry) { assert entry.lockedByCurrentThread(); pendingEntries.remove(new EntryWrapper(entry)); }
/** {@inheritDoc} */ @Override protected void start0() throws IgniteCheckedException { dhtCtx = cctx.isNear() ? cctx.near().dht().context() : cctx; boolean cleanupDisabled = cctx.kernalContext().isDaemon() || !cctx.config().isEagerTtl() || CU.isUtilityCache(cctx.name()) || cctx.dataStructuresCache() || (cctx.kernalContext().clientNode() && cctx.config().getNearConfiguration() == null); if (cleanupDisabled) return; eagerTtlEnabled = true; cctx.shared().ttl().register(this); pendingEntries = (!cctx.isLocal() && cctx.config().getNearConfiguration() != null) ? new GridConcurrentSkipListSetEx() : null; }
/** * @param entry Entry to remove. */ void removeTrackedEntry(GridNearCacheEntry entry) { assert entry.lockedByCurrentThread(); pendingEntries.remove(new EntryWrapper(entry)); }
/** * Adds tracked entry to ttl processor. * * @param entry Entry to add. */ void addTrackedEntry(GridNearCacheEntry entry) { assert entry.lockedByCurrentThread(); EntryWrapper e = new EntryWrapper(entry); pendingEntries.add(e); }
/** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { if (pendingEntries != null) pendingEntries.clear(); cctx.shared().ttl().unregister(this); }
/** * @return The size of pending entries. * @throws IgniteCheckedException If failed. */ public long pendingSize() throws IgniteCheckedException { return (pendingEntries != null ? pendingEntries.sizex() : 0) + cctx.offheap().expiredSize(); }