public class CommandsFactoryImpl extends Object implements CommandsFactory
| Constructor and Description |
|---|
CommandsFactoryImpl() |
| Modifier and Type | Method and Description |
|---|---|
ApplyDeltaCommand |
buildApplyDeltaCommand(Object deltaAwareValueKey,
Delta delta,
Collection keys)
Builds a ApplyDeltaCommand used for applying Delta objects to DeltaAware containers stored in cache
|
CancelCommand |
buildCancelCommandCommand(UUID commandUUID)
Builds CancelCommandCommand used to cancel other commands executing on Infinispan cluster
|
ClearCommand |
buildClearCommand(Set<Flag> flags)
Builds a ClearCommand
|
ClusteredGetCommand |
buildClusteredGetCommand(Object key,
Set<Flag> flags,
boolean acquireRemoteLock,
GlobalTransaction gtx)
Builds a ClusteredGetCommand, which is a remote lookup command
|
CommitCommand |
buildCommitCommand(GlobalTransaction gtx)
Builds a CommitCommand
|
CompleteTransactionCommand |
buildCompleteTransactionCommand(Xid xid,
boolean commit)
Builds a CompleteTransactionCommand command.
|
CreateCacheCommand |
buildCreateCacheCommand(String cacheNameToCreate,
String cacheConfigurationName)
Same as
#buildCreateCacheCommand(String, String, false, 0). |
CreateCacheCommand |
buildCreateCacheCommand(String cacheNameToCreate,
String cacheConfigurationName,
boolean start,
int size)
Builds a CreateCacheCommand used to create/start cache around Infinispan cluster
|
<T> DistributedExecuteCommand<T> |
buildDistributedExecuteCommand(Callable<T> callable,
Address sender,
Collection keys)
Builds a DistributedExecuteCommand used for migration and execution of distributed Callables and Runnables.
|
EntrySetCommand |
buildEntrySetCommand(Set<Flag> flags)
Builds a EntrySetCommand
|
EvictCommand |
buildEvictCommand(Object key,
Set<Flag> flags)
Builds an EvictCommand
|
GetInDoubtTransactionsCommand |
buildGetInDoubtTransactionsCommand()
Builds a
GetInDoubtTransactionsCommand. |
GetInDoubtTxInfoCommand |
buildGetInDoubtTxInfoCommand() |
GetKeyValueCommand |
buildGetKeyValueCommand(Object key,
Set<Flag> flags,
boolean returnEntry)
Builds a GetKeyValueCommand
|
InvalidateCommand |
buildInvalidateCommand(Set<Flag> flags,
Object... keys)
Builds an InvalidateCommand
|
InvalidateCommand |
buildInvalidateFromL1Command(Address origin,
boolean forRehash,
Set<Flag> flags,
Collection<Object> keys) |
InvalidateCommand |
buildInvalidateFromL1Command(boolean forRehash,
Set<Flag> flags,
Collection<Object> keys)
Builds an InvalidateFromL1Command
|
KeySetCommand |
buildKeySetCommand(Set<Flag> flags)
Builds a KeySetCommand
|
LockControlCommand |
buildLockControlCommand(Collection<Object> keys,
Set<Flag> flags,
GlobalTransaction gtx)
Builds a LockControlCommand to control explicit remote locking
|
LockControlCommand |
buildLockControlCommand(Collection keys,
Set<Flag> flags) |
LockControlCommand |
buildLockControlCommand(Object key,
Set<Flag> flags,
GlobalTransaction gtx)
Same as
CommandsFactory.buildLockControlCommand(Object, java.util.Set, org.infinispan.transaction.xa.GlobalTransaction)
but for locking a single key vs a collection of keys. |
<KIn,VIn,KOut,VOut> |
buildMapCombineCommand(String taskId,
Mapper<KIn,VIn,KOut,VOut> m,
Reducer<KOut,VOut> r,
Collection<KIn> keys)
Builds a MapCombineCommand used for migration and map phase execution of MapReduce tasks.
|
PrepareCommand |
buildPrepareCommand(GlobalTransaction gtx,
List<WriteCommand> modifications,
boolean onePhaseCommit)
Builds a PrepareCommand
|
PutKeyValueCommand |
buildPutKeyValueCommand(Object key,
Object value,
Metadata metadata,
Set<Flag> flags)
Builds a PutKeyValueCommand
|
PutMapCommand |
buildPutMapCommand(Map<?,?> map,
Metadata metadata,
Set<Flag> flags)
Builds a PutMapCommand
|
<KOut,VOut> |
buildReduceCommand(String taskId,
String destintationCache,
Reducer<KOut,VOut> r,
Collection<KOut> keys)
Builds a ReduceCommand used for migration and reduce phase execution of MapReduce tasks.
|
RemoveCommand |
buildRemoveCommand(Object key,
Object value,
Set<Flag> flags)
Builds a RemoveCommand
|
ReplaceCommand |
buildReplaceCommand(Object key,
Object oldValue,
Object newValue,
Metadata metadata,
Set<Flag> flags)
Builds a ReplaceCommand
|
MultipleRpcCommand |
buildReplicateCommand(List<ReplicableCommand> toReplicate)
Builds an RpcCommand "envelope" containing multiple ReplicableCommands
|
RollbackCommand |
buildRollbackCommand(GlobalTransaction gtx)
Builds a RollbackCommand
|
SingleRpcCommand |
buildSingleRpcCommand(ReplicableCommand call)
Builds a SingleRpcCommand "envelope" containing a single ReplicableCommand
|
SizeCommand |
buildSizeCommand(Set<Flag> flags)
Builds a SizeCommand
|
StateRequestCommand |
buildStateRequestCommand(StateRequestCommand.Type subtype,
Address sender,
int viewId,
Set<Integer> segments)
Builds a StateRequestCommand used for requesting transactions and locks and for starting or canceling transfer of cache entries.
|
StateResponseCommand |
buildStateResponseCommand(Address sender,
int viewId,
Collection<StateChunk> stateChunks)
Builds a StateResponseCommand used for pushing cache entries to another node in response to a StateRequestCommand.
|
TxCompletionNotificationCommand |
buildTxCompletionNotificationCommand(long internalId) |
TxCompletionNotificationCommand |
buildTxCompletionNotificationCommand(Xid xid,
GlobalTransaction globalTransaction)
Builds a
TxCompletionNotificationCommand. |
ValuesCommand |
buildValuesCommand(Set<Flag> flags)
Builds a ValuesCommand
|
VersionedCommitCommand |
buildVersionedCommitCommand(GlobalTransaction gtx)
Builds a VersionedCommitCommand
|
VersionedPrepareCommand |
buildVersionedPrepareCommand(GlobalTransaction gtx,
List<WriteCommand> modifications,
boolean onePhase)
Builds a VersionedPrepareCommand
|
String |
getCacheName()
Retrieves the cache name this CommandFactory is set up to construct commands for.
|
void |
initializeReplicableCommand(ReplicableCommand c,
boolean isRemote)
Initializes a
ReplicableCommand read from a data stream with components specific
to the target cache instance. |
void |
setupDependencies(DataContainer container,
CacheNotifier notifier,
Cache<Object,Object> cache,
InterceptorChain interceptorChain,
DistributionManager distributionManager,
InvocationContextFactory icf,
TransactionTable txTable,
Configuration configuration,
Map<Byte,ModuleCommandInitializer> moduleCommandInitializers,
RecoveryManager recoveryManager,
StateProvider stateProvider,
StateConsumer stateConsumer,
LockManager lockManager,
InternalEntryFactory entryFactory,
MapReduceManager mapReduceManager,
StateTransferManager stm,
BackupSender backupSender,
CancellationService cancellationService,
TimeService timeService) |
void |
start() |
public void setupDependencies(DataContainer container, CacheNotifier notifier, Cache<Object,Object> cache, InterceptorChain interceptorChain, DistributionManager distributionManager, InvocationContextFactory icf, TransactionTable txTable, Configuration configuration, Map<Byte,ModuleCommandInitializer> moduleCommandInitializers, RecoveryManager recoveryManager, StateProvider stateProvider, StateConsumer stateConsumer, LockManager lockManager, InternalEntryFactory entryFactory, MapReduceManager mapReduceManager, StateTransferManager stm, BackupSender backupSender, CancellationService cancellationService, TimeService timeService)
public void start()
public PutKeyValueCommand buildPutKeyValueCommand(Object key, Object value, Metadata metadata, Set<Flag> flags)
CommandsFactorybuildPutKeyValueCommand in interface CommandsFactorykey - key to putvalue - value to putmetadata - metadata of entryflags - Command flags provided by cachepublic RemoveCommand buildRemoveCommand(Object key, Object value, Set<Flag> flags)
CommandsFactorybuildRemoveCommand in interface CommandsFactorykey - key to removevalue - value to check for ina conditional remove, or null for an unconditional remove.flags - Command flags provided by cachepublic InvalidateCommand buildInvalidateCommand(Set<Flag> flags, Object... keys)
CommandsFactorybuildInvalidateCommand in interface CommandsFactoryflags - Command flags provided by cachekeys - keys to invalidatepublic InvalidateCommand buildInvalidateFromL1Command(boolean forRehash, Set<Flag> flags, Collection<Object> keys)
CommandsFactorybuildInvalidateFromL1Command in interface CommandsFactoryforRehash - set to true if the invalidation is happening due to a new node taking ownership. False if it is due to a write, changing the state of the entry.keys - keys to invalidatepublic InvalidateCommand buildInvalidateFromL1Command(Address origin, boolean forRehash, Set<Flag> flags, Collection<Object> keys)
public ReplaceCommand buildReplaceCommand(Object key, Object oldValue, Object newValue, Metadata metadata, Set<Flag> flags)
CommandsFactorybuildReplaceCommand in interface CommandsFactorykey - key to replaceoldValue - existing value to check for if conditional, null if unconditional.newValue - value to replace withmetadata - metadata of entryflags - Command flags provided by cachepublic SizeCommand buildSizeCommand(Set<Flag> flags)
CommandsFactorybuildSizeCommand in interface CommandsFactoryflags - Command flags provided by cachepublic KeySetCommand buildKeySetCommand(Set<Flag> flags)
CommandsFactorybuildKeySetCommand in interface CommandsFactoryflags - Command flags provided by cachepublic ValuesCommand buildValuesCommand(Set<Flag> flags)
CommandsFactorybuildValuesCommand in interface CommandsFactoryflags - Command flags provided by cachepublic EntrySetCommand buildEntrySetCommand(Set<Flag> flags)
CommandsFactorybuildEntrySetCommand in interface CommandsFactoryflags - Command flags provided by cachepublic GetKeyValueCommand buildGetKeyValueCommand(Object key, Set<Flag> flags, boolean returnEntry)
CommandsFactorybuildGetKeyValueCommand in interface CommandsFactorykey - key to getflags - Command flags provided by cachereturnEntry - boolean indicating whether entire cache entry is
returned, otherwise return just the value partpublic PutMapCommand buildPutMapCommand(Map<?,?> map, Metadata metadata, Set<Flag> flags)
CommandsFactorybuildPutMapCommand in interface CommandsFactorymap - map containing key/value entries to putmetadata - metadata of entryflags - Command flags provided by cachepublic ClearCommand buildClearCommand(Set<Flag> flags)
CommandsFactorybuildClearCommand in interface CommandsFactoryflags - Command flags provided by cachepublic EvictCommand buildEvictCommand(Object key, Set<Flag> flags)
CommandsFactorybuildEvictCommand in interface CommandsFactorykey - key to evictflags - Command flags provided by cachepublic PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhaseCommit)
CommandsFactorybuildPrepareCommand in interface CommandsFactorygtx - global transaction associated with the preparemodifications - list of modificationsonePhaseCommit - is this a one-phase or two-phase transaction?public VersionedPrepareCommand buildVersionedPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhase)
CommandsFactorybuildVersionedPrepareCommand in interface CommandsFactorygtx - global transaction associated with the preparemodifications - list of modificationspublic CommitCommand buildCommitCommand(GlobalTransaction gtx)
CommandsFactorybuildCommitCommand in interface CommandsFactorygtx - global transaction associated with the commitpublic VersionedCommitCommand buildVersionedCommitCommand(GlobalTransaction gtx)
CommandsFactorybuildVersionedCommitCommand in interface CommandsFactorygtx - global transaction associated with the commitpublic RollbackCommand buildRollbackCommand(GlobalTransaction gtx)
CommandsFactorybuildRollbackCommand in interface CommandsFactorygtx - global transaction associated with the rollbackpublic MultipleRpcCommand buildReplicateCommand(List<ReplicableCommand> toReplicate)
CommandsFactorybuildReplicateCommand in interface CommandsFactorytoReplicate - ReplicableCommands to include in the envelopepublic SingleRpcCommand buildSingleRpcCommand(ReplicableCommand call)
CommandsFactorybuildSingleRpcCommand in interface CommandsFactorycall - ReplicableCommand to include in the envelopepublic ClusteredGetCommand buildClusteredGetCommand(Object key, Set<Flag> flags, boolean acquireRemoteLock, GlobalTransaction gtx)
CommandsFactorybuildClusteredGetCommand in interface CommandsFactorykey - key to look uppublic void initializeReplicableCommand(ReplicableCommand c, boolean isRemote)
CommandsFactoryReplicableCommand read from a data stream with components specific
to the target cache instance.
Implementations should also be deep, in that if the command contains other commands, these should be recursed
into.
initializeReplicableCommand in interface CommandsFactoryisRemote - true if the command is deserialized and is executed remote.c - command to initialize. Cannot be null.public LockControlCommand buildLockControlCommand(Collection<Object> keys, Set<Flag> flags, GlobalTransaction gtx)
CommandsFactorybuildLockControlCommand in interface CommandsFactorykeys - keys to lockpublic LockControlCommand buildLockControlCommand(Object key, Set<Flag> flags, GlobalTransaction gtx)
CommandsFactoryCommandsFactory.buildLockControlCommand(Object, java.util.Set, org.infinispan.transaction.xa.GlobalTransaction)
but for locking a single key vs a collection of keys.buildLockControlCommand in interface CommandsFactorypublic LockControlCommand buildLockControlCommand(Collection keys, Set<Flag> flags)
buildLockControlCommand in interface CommandsFactorypublic StateRequestCommand buildStateRequestCommand(StateRequestCommand.Type subtype, Address sender, int viewId, Set<Integer> segments)
CommandsFactorybuildStateRequestCommand in interface CommandsFactorypublic StateResponseCommand buildStateResponseCommand(Address sender, int viewId, Collection<StateChunk> stateChunks)
CommandsFactorybuildStateResponseCommand in interface CommandsFactorypublic String getCacheName()
CommandsFactorygetCacheName in interface CommandsFactorypublic GetInDoubtTransactionsCommand buildGetInDoubtTransactionsCommand()
CommandsFactoryGetInDoubtTransactionsCommand.buildGetInDoubtTransactionsCommand in interface CommandsFactorypublic TxCompletionNotificationCommand buildTxCompletionNotificationCommand(Xid xid, GlobalTransaction globalTransaction)
CommandsFactoryTxCompletionNotificationCommand.buildTxCompletionNotificationCommand in interface CommandsFactorypublic TxCompletionNotificationCommand buildTxCompletionNotificationCommand(long internalId)
buildTxCompletionNotificationCommand in interface CommandsFactoryinternalId - the internal id identifying the transaction to be removed.TxCompletionNotificationCommandpublic <T> DistributedExecuteCommand<T> buildDistributedExecuteCommand(Callable<T> callable, Address sender, Collection keys)
CommandsFactorybuildDistributedExecuteCommand in interface CommandsFactorycallable - the callable tasksender - sender's Addresskeys - keys used in Callablepublic <KIn,VIn,KOut,VOut> MapCombineCommand<KIn,VIn,KOut,VOut> buildMapCombineCommand(String taskId, Mapper<KIn,VIn,KOut,VOut> m, Reducer<KOut,VOut> r, Collection<KIn> keys)
CommandsFactorybuildMapCombineCommand in interface CommandsFactorym - Mapper for MapReduceTaskr - Combiner for MapReduceTaskkeys - keys used in MapReduceTaskpublic GetInDoubtTxInfoCommand buildGetInDoubtTxInfoCommand()
buildGetInDoubtTxInfoCommand in interface CommandsFactoryGetInDoubtTxInfoCommandpublic CompleteTransactionCommand buildCompleteTransactionCommand(Xid xid, boolean commit)
CommandsFactorybuildCompleteTransactionCommand in interface CommandsFactoryxid - the xid identifying the transaction we want to complete.commit - commit(true) or rollback(false)?public ApplyDeltaCommand buildApplyDeltaCommand(Object deltaAwareValueKey, Delta delta, Collection keys)
CommandsFactorybuildApplyDeltaCommand in interface CommandsFactoryApplyDeltaCommandpublic CreateCacheCommand buildCreateCacheCommand(String cacheNameToCreate, String cacheConfigurationName)
CommandsFactory#buildCreateCacheCommand(String, String, false, 0).buildCreateCacheCommand in interface CommandsFactorypublic CreateCacheCommand buildCreateCacheCommand(String cacheNameToCreate, String cacheConfigurationName, boolean start, int size)
CommandsFactorybuildCreateCacheCommand in interface CommandsFactorystart - if true, then this command also makes sure that the cache is started on all the nodes in the cluster.size - the expected number of nodes where this node runspublic <KOut,VOut> ReduceCommand<KOut,VOut> buildReduceCommand(String taskId, String destintationCache, Reducer<KOut,VOut> r, Collection<KOut> keys)
CommandsFactorybuildReduceCommand in interface CommandsFactoryr - Reducer for MapReduceTaskkeys - keys used in MapReduceTaskpublic CancelCommand buildCancelCommandCommand(UUID commandUUID)
CommandsFactorybuildCancelCommandCommand in interface CommandsFactorycommandUUID - UUID for command to cancelCopyright © 2014 JBoss, a division of Red Hat. All rights reserved.