@MBean(objectName="CacheLoader", description="Component that handles loading entries from a CacheStore into memory.") public class CacheLoaderInterceptor<K,V> extends JmxStatsCommandInterceptor implements EntryLoader<K,V>
Modifier and Type | Field and Description |
---|---|
protected boolean |
activation |
protected AtomicLong |
cacheLoads |
protected AtomicLong |
cacheMisses |
protected EntryFactory |
entryFactory |
protected ExecutorService |
nonBlockingExecutor |
protected CacheNotifier |
notifier |
protected PersistenceManager |
persistenceManager |
cacheConfiguration
Constructor and Description |
---|
CacheLoaderInterceptor() |
getStatisticsEnabled, onStart, setStatisticsEnabled
handleDefault, visitClearCommand, visitCommand, visitCommitCommand, visitEvictCommand, visitInvalidateCommand, visitInvalidateL1Command, visitLockControlCommand, visitPrepareCommand, visitPutMapCommand, visitRollbackCommand, visitUnknownCommand, visitWriteOnlyKeyCommand, visitWriteOnlyKeyValueCommand, visitWriteOnlyManyCommand, visitWriteOnlyManyEntriesCommand
asyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedNull, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrException
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
loadAndStoreInDataContainer
visitRemoveExpiredCommand
protected final AtomicLong cacheLoads
protected final AtomicLong cacheMisses
protected PersistenceManager persistenceManager
protected CacheNotifier notifier
protected EntryFactory entryFactory
protected ExecutorService nonBlockingExecutor
protected boolean activation
public void start()
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command)
visitPutKeyValueCommand
in interface Visitor
visitPutKeyValueCommand
in class DDAsyncInterceptor
public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command)
visitGetKeyValueCommand
in interface Visitor
visitGetKeyValueCommand
in class DDAsyncInterceptor
public Object visitGetCacheEntryCommand(InvocationContext ctx, GetCacheEntryCommand command)
visitGetCacheEntryCommand
in interface Visitor
visitGetCacheEntryCommand
in class DDAsyncInterceptor
public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command)
visitGetAllCommand
in interface Visitor
visitGetAllCommand
in class DDAsyncInterceptor
public Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command)
visitRemoveCommand
in interface Visitor
visitRemoveCommand
in class DDAsyncInterceptor
public Object visitReplaceCommand(InvocationContext ctx, ReplaceCommand command)
visitReplaceCommand
in interface Visitor
visitReplaceCommand
in class DDAsyncInterceptor
public Object visitComputeCommand(InvocationContext ctx, ComputeCommand command)
visitComputeCommand
in interface Visitor
visitComputeCommand
in class DDAsyncInterceptor
public Object visitComputeIfAbsentCommand(InvocationContext ctx, ComputeIfAbsentCommand command)
visitComputeIfAbsentCommand
in interface Visitor
visitComputeIfAbsentCommand
in class DDAsyncInterceptor
public Object visitGetKeysInGroupCommand(InvocationContext ctx, GetKeysInGroupCommand command)
visitGetKeysInGroupCommand
in interface Visitor
visitGetKeysInGroupCommand
in class DDAsyncInterceptor
public Object visitEntrySetCommand(InvocationContext ctx, EntrySetCommand command) throws Throwable
visitEntrySetCommand
in interface Visitor
visitEntrySetCommand
in class DDAsyncInterceptor
Throwable
public Object visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable
visitKeySetCommand
in interface Visitor
visitKeySetCommand
in class DDAsyncInterceptor
Throwable
public Object visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command)
visitReadOnlyKeyCommand
in interface Visitor
visitReadOnlyKeyCommand
in class DDAsyncInterceptor
public Object visitReadOnlyManyCommand(InvocationContext ctx, ReadOnlyManyCommand command)
visitReadOnlyManyCommand
in interface Visitor
visitReadOnlyManyCommand
in class DDAsyncInterceptor
public Object visitReadWriteKeyCommand(InvocationContext ctx, ReadWriteKeyCommand command) throws Throwable
visitReadWriteKeyCommand
in interface Visitor
visitReadWriteKeyCommand
in class DDAsyncInterceptor
Throwable
public Object visitReadWriteKeyValueCommand(InvocationContext ctx, ReadWriteKeyValueCommand command)
visitReadWriteKeyValueCommand
in interface Visitor
visitReadWriteKeyValueCommand
in class DDAsyncInterceptor
public Object visitReadWriteManyCommand(InvocationContext ctx, ReadWriteManyCommand command)
visitReadWriteManyCommand
in interface Visitor
visitReadWriteManyCommand
in class DDAsyncInterceptor
public Object visitReadWriteManyEntriesCommand(InvocationContext ctx, ReadWriteManyEntriesCommand command) throws Throwable
visitReadWriteManyEntriesCommand
in interface Visitor
visitReadWriteManyEntriesCommand
in class DDAsyncInterceptor
Throwable
public Object visitSizeCommand(InvocationContext ctx, SizeCommand command)
visitSizeCommand
in interface Visitor
visitSizeCommand
in class DDAsyncInterceptor
protected final boolean isConditional(WriteCommand cmd)
protected final boolean hasSkipLoadFlag(FlagAffectedCommand cmd)
protected boolean canLoad(Object key)
protected final CompletionStage<Void> loadIfNeeded(InvocationContext ctx, Object key, FlagAffectedCommand cmd)
ctx
- The current invocation's contextkey
- The key for the entry to look upcmd
- The command that was called that now wants to query the cache loaderThrowable
protected CompletionStage<Void> loadInContext(InvocationContext ctx, Object key, FlagAffectedCommand cmd)
ctx
- context for this invocationkey
- key to find the entry forcmd
- the command that initiated this loadpublic CompletionStage<InternalCacheEntry<K,V>> loadAndStoreInDataContainer(InvocationContext ctx, Object key, int segment, FlagAffectedCommand cmd)
EntryLoader
loadAndStoreInDataContainer
in interface EntryLoader<K,V>
ctx
- context that generated this requestkey
- key to load from the storesegment
- segment of the key to loadcmd
- the command that generated this load requestprotected boolean skipLoadForWriteCommand(WriteCommand cmd, Object key, InvocationContext ctx)
protected CompletionStage<Void> sendNotification(Object key, Object value, boolean pre, InvocationContext ctx, FlagAffectedCommand cmd)
@ManagedAttribute(description="Number of entries loaded from cache store", displayName="Number of cache store loads", measurementType=TRENDSUP) public long getCacheLoaderLoads()
@ManagedAttribute(description="Number of entries that did not exist in cache store", displayName="Number of cache store load misses", measurementType=TRENDSUP) public long getCacheLoaderMisses()
public void resetStatistics()
JmxStatsCommandInterceptor
resetStatistics
in interface JmxStatisticsExposer
resetStatistics
in class JmxStatsCommandInterceptor
@ManagedAttribute(description="Returns a collection of cache loader types which are configured and enabled", displayName="Returns a collection of cache loader types which are configured and enabled") public Collection<String> getStores()
@ManagedOperation(description="Disable all stores of a given type, where type is a fully qualified class name of the cache loader to disable", displayName="Disable all stores of a given type") public void disableStore(@Parameter(name="storeType",description="Fully qualified class name of a store implementation") String storeType)
storeType
- fully qualified class name of the cache loader type to disableCopyright © 2021 JBoss by Red Hat. All rights reserved.