|
Infinispan Distribution 5.2.6.Final-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infinispan.commands.CommandsFactoryImpl
public class CommandsFactoryImpl
Constructor Summary | |
---|---|
CommandsFactoryImpl()
|
Method Summary | ||
---|---|---|
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) . |
|
CreateCacheCommand |
buildCreateCacheCommand(String cacheNameToCreate,
String cacheConfigurationName,
boolean start,
int size)
Builds a CreateCacheCommand used to create/start cache around Infinispan cluster |
|
|
buildDistributedExecuteCommand(Callable<T> callable,
Address sender,
Collection keys)
Builds a DistributedExecuteCommand used for migration and execution of distributed Callables and Runnables. |
|
EntrySetCommand |
buildEntrySetCommand()
Builds a EntrySetCommand |
|
EvictCommand |
buildEvictCommand(Object key,
Set<Flag> flags)
Builds an EvictCommand |
|
GetCacheEntryCommand |
buildGetCacheEntryCommand(Object key,
Set<Flag> flags)
Builds a GetKeyValueCommand |
|
GetInDoubtTransactionsCommand |
buildGetInDoubtTransactionsCommand()
Builds a GetInDoubtTransactionsCommand . |
|
GetInDoubtTxInfoCommand |
buildGetInDoubtTxInfoCommand()
|
|
GetKeyValueCommand |
buildGetKeyValueCommand(Object key,
Set<Flag> flags)
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 |
|
InvalidateCommand |
buildInvalidateFromL1Command(boolean forRehash,
Set<Flag> flags,
Object... keys)
Builds an InvalidateFromL1Command |
|
KeySetCommand |
buildKeySetCommand()
Builds a KeySetCommand |
|
LockControlCommand |
buildLockControlCommand(Collection<Object> keys,
Set<Flag> flags)
|
|
LockControlCommand |
buildLockControlCommand(Collection<Object> keys,
Set<Flag> flags,
GlobalTransaction gtx)
Builds a LockControlCommand to control explicit remote locking |
|
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. |
|
|
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,
long lifespanMillis,
long maxIdleTimeMillis,
Set<Flag> flags)
Builds a PutKeyValueCommand |
|
PutMapCommand |
buildPutMapCommand(Map<?,?> map,
long lifespan,
long maxIdleTimeMillis,
Set<Flag> flags)
Builds a PutMapCommand |
|
|
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,
long lifespan,
long maxIdleTimeMillis,
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()
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()
Builds a ValuesCommand |
|
VersionedCommitCommand |
buildVersionedCommitCommand(GlobalTransaction gtx)
Builds a VersionedCommitCommand |
|
VersionedPrepareCommand |
buildVersionedPrepareCommand(GlobalTransaction gtx,
List<WriteCommand> modifications,
boolean onePhase)
Builds a VersionedPrepareCommand |
|
VersionedPutKeyValueCommand |
buildVersionedPutKeyValueCommand(Object key,
Object value,
long lifespanMillis,
long maxIdleTimeMillis,
EntryVersion version,
Set<Flag> flags)
Builds a special form of PutKeyValueCommand that also holds a reference to a version to be applied. |
|
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,
InvocationContextContainer icc,
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)
|
|
void |
start()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandsFactoryImpl()
Method Detail |
---|
public void setupDependencies(DataContainer container, CacheNotifier notifier, Cache<Object,Object> cache, InterceptorChain interceptorChain, DistributionManager distributionManager, InvocationContextContainer icc, 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)
public void start()
public PutKeyValueCommand buildPutKeyValueCommand(Object key, Object value, long lifespanMillis, long maxIdleTimeMillis, Set<Flag> flags)
CommandsFactory
buildPutKeyValueCommand
in interface CommandsFactory
key
- key to putvalue
- value to putlifespanMillis
- lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis
- max idle time in milliseconds. -1 if maxIdle is not used.
public VersionedPutKeyValueCommand buildVersionedPutKeyValueCommand(Object key, Object value, long lifespanMillis, long maxIdleTimeMillis, EntryVersion version, Set<Flag> flags)
CommandsFactory
PutKeyValueCommand
that also holds a reference to a version to be applied.
buildVersionedPutKeyValueCommand
in interface CommandsFactory
key
- key to putvalue
- value to putlifespanMillis
- lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis
- max idle time in milliseconds. -1 if maxIdle is not used.version
- version to apply with this put
public RemoveCommand buildRemoveCommand(Object key, Object value, Set<Flag> flags)
CommandsFactory
buildRemoveCommand
in interface CommandsFactory
key
- key to removevalue
- value to check for ina conditional remove, or null for an unconditional remove.
public InvalidateCommand buildInvalidateCommand(Set<Flag> flags, Object... keys)
CommandsFactory
buildInvalidateCommand
in interface CommandsFactory
keys
- keys to invalidate
public InvalidateCommand buildInvalidateFromL1Command(boolean forRehash, Set<Flag> flags, Object... keys)
CommandsFactory
buildInvalidateFromL1Command
in interface CommandsFactory
forRehash
- 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 invalidate
public InvalidateCommand buildInvalidateFromL1Command(boolean forRehash, Set<Flag> flags, Collection<Object> keys)
CommandsFactory
buildInvalidateFromL1Command
in interface CommandsFactory
forRehash
- 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 invalidate
public InvalidateCommand buildInvalidateFromL1Command(Address origin, boolean forRehash, Set<Flag> flags, Collection<Object> keys)
buildInvalidateFromL1Command
in interface CommandsFactory
CommandsFactory.buildInvalidateFromL1Command(org.infinispan.remoting.transport.Address, boolean, java.util.Set, java.util.Collection)
public ReplaceCommand buildReplaceCommand(Object key, Object oldValue, Object newValue, long lifespan, long maxIdleTimeMillis, Set<Flag> flags)
CommandsFactory
buildReplaceCommand
in interface CommandsFactory
key
- key to replaceoldValue
- existing value to check for if conditional, null if unconditional.newValue
- value to replace withlifespan
- lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis
- max idle time in milliseconds. -1 if maxIdle is not used.
public SizeCommand buildSizeCommand()
CommandsFactory
buildSizeCommand
in interface CommandsFactory
public KeySetCommand buildKeySetCommand()
CommandsFactory
buildKeySetCommand
in interface CommandsFactory
public ValuesCommand buildValuesCommand()
CommandsFactory
buildValuesCommand
in interface CommandsFactory
public EntrySetCommand buildEntrySetCommand()
CommandsFactory
buildEntrySetCommand
in interface CommandsFactory
public GetKeyValueCommand buildGetKeyValueCommand(Object key, Set<Flag> flags)
CommandsFactory
buildGetKeyValueCommand
in interface CommandsFactory
key
- key to get
public GetCacheEntryCommand buildGetCacheEntryCommand(Object key, Set<Flag> flags)
CommandsFactory
buildGetCacheEntryCommand
in interface CommandsFactory
key
- key to get
public PutMapCommand buildPutMapCommand(Map<?,?> map, long lifespan, long maxIdleTimeMillis, Set<Flag> flags)
CommandsFactory
buildPutMapCommand
in interface CommandsFactory
map
- map containing key/value entries to putlifespan
- lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis
- max idle time in milliseconds. -1 if maxIdle is not used.
public ClearCommand buildClearCommand(Set<Flag> flags)
CommandsFactory
buildClearCommand
in interface CommandsFactory
public EvictCommand buildEvictCommand(Object key, Set<Flag> flags)
CommandsFactory
buildEvictCommand
in interface CommandsFactory
key
- key to evict
public PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhaseCommit)
CommandsFactory
buildPrepareCommand
in interface CommandsFactory
gtx
- 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)
CommandsFactory
buildVersionedPrepareCommand
in interface CommandsFactory
gtx
- global transaction associated with the preparemodifications
- list of modifications
public CommitCommand buildCommitCommand(GlobalTransaction gtx)
CommandsFactory
buildCommitCommand
in interface CommandsFactory
gtx
- global transaction associated with the commit
public VersionedCommitCommand buildVersionedCommitCommand(GlobalTransaction gtx)
CommandsFactory
buildVersionedCommitCommand
in interface CommandsFactory
gtx
- global transaction associated with the commit
public RollbackCommand buildRollbackCommand(GlobalTransaction gtx)
CommandsFactory
buildRollbackCommand
in interface CommandsFactory
gtx
- global transaction associated with the rollback
public MultipleRpcCommand buildReplicateCommand(List<ReplicableCommand> toReplicate)
CommandsFactory
buildReplicateCommand
in interface CommandsFactory
toReplicate
- ReplicableCommands to include in the envelope
public SingleRpcCommand buildSingleRpcCommand(ReplicableCommand call)
CommandsFactory
buildSingleRpcCommand
in interface CommandsFactory
call
- ReplicableCommand to include in the envelope
public ClusteredGetCommand buildClusteredGetCommand(Object key, Set<Flag> flags, boolean acquireRemoteLock, GlobalTransaction gtx)
CommandsFactory
buildClusteredGetCommand
in interface CommandsFactory
key
- key to look up
public void initializeReplicableCommand(ReplicableCommand c, boolean isRemote)
CommandsFactory
ReplicableCommand
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 CommandsFactory
isRemote
- 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)
CommandsFactory
buildLockControlCommand
in interface CommandsFactory
keys
- keys to lock
public LockControlCommand buildLockControlCommand(Object key, Set<Flag> flags, GlobalTransaction gtx)
CommandsFactory
CommandsFactory.buildLockControlCommand(Object, java.util.Set, org.infinispan.transaction.xa.GlobalTransaction)
but for locking a single key vs a collection of keys.
buildLockControlCommand
in interface CommandsFactory
public LockControlCommand buildLockControlCommand(Collection<Object> keys, Set<Flag> flags)
buildLockControlCommand
in interface CommandsFactory
public StateRequestCommand buildStateRequestCommand(StateRequestCommand.Type subtype, Address sender, int viewId, Set<Integer> segments)
CommandsFactory
buildStateRequestCommand
in interface CommandsFactory
public StateResponseCommand buildStateResponseCommand(Address sender, int viewId, Collection<StateChunk> stateChunks)
CommandsFactory
buildStateResponseCommand
in interface CommandsFactory
public String getCacheName()
CommandsFactory
getCacheName
in interface CommandsFactory
public GetInDoubtTransactionsCommand buildGetInDoubtTransactionsCommand()
CommandsFactory
GetInDoubtTransactionsCommand
.
buildGetInDoubtTransactionsCommand
in interface CommandsFactory
public TxCompletionNotificationCommand buildTxCompletionNotificationCommand(Xid xid, GlobalTransaction globalTransaction)
CommandsFactory
TxCompletionNotificationCommand
.
buildTxCompletionNotificationCommand
in interface CommandsFactory
public TxCompletionNotificationCommand buildTxCompletionNotificationCommand(long internalId)
buildTxCompletionNotificationCommand
in interface CommandsFactory
internalId
- the internal id identifying the transaction to be removed.TxCompletionNotificationCommand
public <T> DistributedExecuteCommand<T> buildDistributedExecuteCommand(Callable<T> callable, Address sender, Collection keys)
CommandsFactory
buildDistributedExecuteCommand
in interface CommandsFactory
callable
- the callable tasksender
- sender's Addresskeys
- keys used in Callable
public <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)
CommandsFactory
buildMapCombineCommand
in interface CommandsFactory
m
- Mapper for MapReduceTaskr
- Combiner for MapReduceTaskkeys
- keys used in MapReduceTask
public GetInDoubtTxInfoCommand buildGetInDoubtTxInfoCommand()
buildGetInDoubtTxInfoCommand
in interface CommandsFactory
GetInDoubtTxInfoCommand
public CompleteTransactionCommand buildCompleteTransactionCommand(Xid xid, boolean commit)
CommandsFactory
buildCompleteTransactionCommand
in interface CommandsFactory
xid
- the xid identifying the transaction we want to complete.commit
- commit(true) or rollback(false)?public ApplyDeltaCommand buildApplyDeltaCommand(Object deltaAwareValueKey, Delta delta, Collection keys)
CommandsFactory
buildApplyDeltaCommand
in interface CommandsFactory
ApplyDeltaCommand
public CreateCacheCommand buildCreateCacheCommand(String cacheNameToCreate, String cacheConfigurationName)
CommandsFactory
#buildCreateCacheCommand(String, String, false)
.
buildCreateCacheCommand
in interface CommandsFactory
public CreateCacheCommand buildCreateCacheCommand(String cacheNameToCreate, String cacheConfigurationName, boolean start, int size)
CommandsFactory
buildCreateCacheCommand
in interface CommandsFactory
start
- 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)
CommandsFactory
buildReduceCommand
in interface CommandsFactory
r
- Reducer for MapReduceTaskkeys
- keys used in MapReduceTask
public CancelCommand buildCancelCommandCommand(UUID commandUUID)
CommandsFactory
buildCancelCommandCommand
in interface CommandsFactory
commandUUID
- UUID for command to cancel
|
Infinispan Distribution 5.2.6.Final-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |