Class GridCacheTtlManager
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter
-
- org.apache.ignite.internal.processors.cache.GridCacheTtlManager
-
- All Implemented Interfaces:
GridCacheManager
public class GridCacheTtlManager extends GridCacheManagerAdapter
Eagerly removes expired entries from cache whenCacheConfiguration.isEagerTtl()flag is set.
-
-
Field Summary
Fields Modifier and Type Field Description static longDFLT_UNWIND_THROTTLING_TIMEOUTprotected booleanhasPendingEntriesIndicates thatprotected longnextCleanTimeTimestamp when next clean try will be allowed.-
Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter
cctx, log, starting
-
-
Constructor Summary
Constructors Constructor Description GridCacheTtlManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleaneagerTtlEnabled()booleanexpire(int amount)Processes specified amount of expired entries.booleanhasPendingEntries()voidhasPendingEntries(boolean update)Updates the flaghasPendingEntrieswith the given value.protected voidonKernalStop0(boolean cancel)longpendingSize()voidprintMemoryStats()Prints memory statistics (sizes of internal data structures, etc.).protected voidstart0()voidunregister()Unregister this TTL manager of cache from periodical check on expired entries.-
Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter
context, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, start, startInfo, stop, stop0, stopInfo, toString
-
-
-
-
Field Detail
-
DFLT_UNWIND_THROTTLING_TIMEOUT
public static final long DFLT_UNWIND_THROTTLING_TIMEOUT
-
hasPendingEntries
protected volatile boolean hasPendingEntries
Indicates that
-
nextCleanTime
protected volatile long nextCleanTime
Timestamp when next clean try will be allowed. Used for throttling on per-cache basis.
-
-
Method Detail
-
start0
protected void start0() throws IgniteCheckedException- Overrides:
start0in classGridCacheManagerAdapter- Throws:
IgniteCheckedException- If failed.
-
eagerTtlEnabled
public boolean eagerTtlEnabled()
- Returns:
Trueif eager ttl is enabled for cache.
-
onKernalStop0
protected void onKernalStop0(boolean cancel)
- Overrides:
onKernalStop0in classGridCacheManagerAdapter- Parameters:
cancel- Cancel flag.
-
unregister
public void unregister()
Unregister this TTL manager of cache from periodical check on expired entries.
-
pendingSize
public long pendingSize() throws IgniteCheckedException- Returns:
- The size of pending entries.
- Throws:
IgniteCheckedException- If failed.
-
hasPendingEntries
public void hasPendingEntries(boolean update)
Updates the flaghasPendingEntrieswith the given value.- Parameters:
update-trueif the underlying pending tree has entries with expire policy enabled.
-
hasPendingEntries
public boolean hasPendingEntries()
- Returns:
trueif the underlying pending tree has entries with expire policy enabled.
-
printMemoryStats
public void printMemoryStats()
Prints memory statistics (sizes of internal data structures, etc.). NOTE: this method is for testing and profiling purposes only.- Specified by:
printMemoryStatsin interfaceGridCacheManager- Overrides:
printMemoryStatsin classGridCacheManagerAdapter
-
expire
public boolean expire(int amount)
Processes specified amount of expired entries.- Parameters:
amount- Limit of processed entries by single call,-1for no limit.- Returns:
Trueif unprocessed expired entries remains.
-
-