Package org.infinispan.commands
Class CommandsFactoryImpl
- java.lang.Object
-
- org.infinispan.commands.CommandsFactoryImpl
-
- All Implemented Interfaces:
CommandsFactory
public class CommandsFactoryImpl extends Object implements CommandsFactory
- Since:
- 4.0
- Author:
- Mircea.Markus@jboss.com, Galder ZamarreƱo, Sanne Grinovero <sanne@hibernate.org> (C) 2011 Red Hat Inc.
-
-
Constructor Summary
Constructors Constructor Description CommandsFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BackupAckCommand
buildBackupAckCommand(long id, int topologyId)
BackupMultiKeyAckCommand
buildBackupMultiKeyAckCommand(long id, int segment, int topologyId)
CancelCommand
buildCancelCommandCommand(UUID commandUUID)
Builds CancelCommandCommand used to cancel other commands executing on Infinispan clusterClearCommand
buildClearCommand(long flagsBitSet)
Builds a ClearCommandClusteredGetAllCommand
buildClusteredGetAllCommand(List<?> keys, long flagsBitSet, GlobalTransaction gtx)
Builds a ClusteredGetAllCommand, which is a remote lookup commandClusteredGetCommand
buildClusteredGetCommand(Object key, int segment, long flagsBitSet)
Builds a ClusteredGetCommand, which is a remote lookup commandCommitCommand
buildCommitCommand(GlobalTransaction gtx)
Builds a CommitCommandCompleteTransactionCommand
buildCompleteTransactionCommand(Xid xid, boolean commit)
Builds a CompleteTransactionCommand command.ComputeCommand
buildComputeCommand(Object key, BiFunction mappingFunction, boolean computeIfPresent, int segment, Metadata metadata, long flagsBitSet)
Builds a ComputeCommandComputeIfAbsentCommand
buildComputeIfAbsentCommand(Object key, Function mappingFunction, int segment, Metadata metadata, long flagsBitSet)
Builds a ComputeIfAbsentCommandCreateCacheCommand
buildCreateCacheCommand(String cacheNameToCreate, String cacheConfigurationName)
Same asbuildCreateCacheCommand(cacheName, cacheConfigurationName, false, 0)
.CreateCacheCommand
buildCreateCacheCommand(String cacheNameToCreate, String cacheConfigurationName, 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(long flagsBitSet)
Builds a EntrySetCommandEvictCommand
buildEvictCommand(Object key, int segment, long flagsBitSet)
Builds an EvictCommandExceptionAckCommand
buildExceptionAckCommand(long id, Throwable throwable, int topologyId)
GetAllCommand
buildGetAllCommand(Collection<?> keys, long flagsBitSet, boolean returnEntries)
Builds a GetAllCommandGetCacheEntryCommand
buildGetCacheEntryCommand(Object key, int segment, long flagsBitSet)
Builds a GetCacheEntryCommandGetInDoubtTransactionsCommand
buildGetInDoubtTransactionsCommand()
Builds aGetInDoubtTransactionsCommand
.GetInDoubtTxInfoCommand
buildGetInDoubtTxInfoCommand()
GetKeysInGroupCommand
buildGetKeysInGroupCommand(long flagsBitSet, Object groupName)
BuildsGetKeysInGroupCommand
used to fetch all the keys belonging to a group.GetKeyValueCommand
buildGetKeyValueCommand(Object key, int segment, long flagsBitSet)
Builds a GetKeyValueCommandInvalidateCommand
buildInvalidateCommand(long flagsBitSet, Object... keys)
Builds an InvalidateCommandInvalidateCommand
buildInvalidateFromL1Command(long flagsBitSet, Collection<Object> keys)
Builds an InvalidateFromL1CommandInvalidateCommand
buildInvalidateFromL1Command(Address origin, long flagsBitSet, Collection<Object> keys)
InvalidateVersionsCommand
buildInvalidateVersionsCommand(int topologyId, Object[] keys, int[] topologyIds, long[] versions, boolean removed)
KeySetCommand
buildKeySetCommand(long flagsBitSet)
Builds a KeySetCommandLockControlCommand
buildLockControlCommand(Object key, long flagsBitSet, GlobalTransaction gtx)
Same asCommandsFactory.buildLockControlCommand(Object, long, GlobalTransaction)
but for locking a single key vs a collection of keys.LockControlCommand
buildLockControlCommand(Collection<?> keys, long flagsBitSet)
LockControlCommand
buildLockControlCommand(Collection<?> keys, long flagsBitSet, GlobalTransaction gtx)
Builds a LockControlCommand to control explicit remote lockingMultiEntriesFunctionalBackupWriteCommand
buildMultiEntriesFunctionalBackupWriteCommand()
MultiKeyFunctionalBackupWriteCommand
buildMultiKeyFunctionalBackupWriteCommand()
PrepareCommand
buildPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhaseCommit)
Builds a PrepareCommandPutKeyValueCommand
buildPutKeyValueCommand(Object key, Object value, int segment, Metadata metadata, long flagsBitSet)
Builds a PutKeyValueCommandPutMapBackupWriteCommand
buildPutMapBackupWriteCommand()
PutMapCommand
buildPutMapCommand(Map<?,?> map, Metadata metadata, long flagsBitSet)
Builds a PutMapCommand<K,V,R>
ReadOnlyKeyCommand<K,V,R>buildReadOnlyKeyCommand(Object key, Function<EntryView.ReadEntryView<K,V>,R> f, int segment, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,R>
ReadOnlyManyCommand<K,V,R>buildReadOnlyManyCommand(Collection<?> keys, Function<EntryView.ReadEntryView<K,V>,R> f, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,R>
ReadWriteKeyCommand<K,V,R>buildReadWriteKeyCommand(Object key, Function<EntryView.ReadWriteEntryView<K,V>,R> f, int segment, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,T,R>
ReadWriteKeyValueCommand<K,V,T,R>buildReadWriteKeyValueCommand(Object key, Object argument, BiFunction<T,EntryView.ReadWriteEntryView<K,V>,R> f, int segment, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,R>
ReadWriteManyCommand<K,V,R>buildReadWriteManyCommand(Collection<?> keys, Function<EntryView.ReadWriteEntryView<K,V>,R> f, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,T,R>
ReadWriteManyEntriesCommand<K,V,T,R>buildReadWriteManyEntriesCommand(Map<?,?> entries, BiFunction<T,EntryView.ReadWriteEntryView<K,V>,R> f, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
RemoveCommand
buildRemoveCommand(Object key, Object value, int segment, long flagsBitSet)
Builds a RemoveCommandRemoveExpiredCommand
buildRemoveExpiredCommand(Object key, Object value, int segment, long flagsBitSet)
Builds an expired remove command that is used to remove only a specific entry when it expires via maxIdleRemoveExpiredCommand
buildRemoveExpiredCommand(Object key, Object value, int segment, Long lifespan, long flagsBitSet)
Builds an expired remove command that is used to remove only a specific entry when it expires via lifespanRenewBiasCommand
buildRenewBiasCommand(Object[] keys)
ReplaceCommand
buildReplaceCommand(Object key, Object oldValue, Object newValue, int segment, Metadata metadata, long flagsBitSet)
Builds a ReplaceCommandRevokeBiasCommand
buildRevokeBiasCommand(Address ackTarget, long id, int topologyId, Collection<Object> keys)
RollbackCommand
buildRollbackCommand(GlobalTransaction gtx)
Builds a RollbackCommandSingleKeyBackupWriteCommand
buildSingleKeyBackupWriteCommand()
SingleKeyFunctionalBackupWriteCommand
buildSingleKeyFunctionalBackupWriteCommand()
SingleRpcCommand
buildSingleRpcCommand(ReplicableCommand call)
Builds a SingleRpcCommand "envelope" containing a single ReplicableCommandSingleXSiteRpcCommand
buildSingleXSiteRpcCommand(VisitableCommand command)
Builds SingleRpcCommand used to performVisitableCommand
on the backup site,SizeCommand
buildSizeCommand(long flagsBitSet)
Builds a SizeCommandStateRequestCommand
buildStateRequestCommand(StateRequestCommand.Type subtype, Address sender, int topologyId, IntSet segments)
Builds a StateRequestCommand used for requesting transactions and locks and for starting or canceling transfer of cache entries.StateResponseCommand
buildStateResponseCommand(Address sender, int topologyId, Collection<StateChunk> stateChunks, boolean applyState, boolean pushTransfer)
Builds a StateResponseCommand used for pushing cache entries to another node in response to a StateRequestCommand.org.infinispan.stream.impl.StreamIteratorCloseCommand
buildStreamIteratorCloseCommand(Object id)
org.infinispan.stream.impl.StreamIteratorNextCommand
buildStreamIteratorNextCommand(Object id, long batchSize)
<K> org.infinispan.stream.impl.StreamIteratorRequestCommand<K>
buildStreamIteratorRequestCommand(Object id, boolean parallelStream, IntSet segments, Set<K> keys, Set<K> excludedKeys, boolean includeLoader, boolean entryStream, Iterable<org.infinispan.stream.impl.intops.IntermediateOperation> intOps, long batchSize)
<K> org.infinispan.stream.impl.StreamRequestCommand<K>
buildStreamRequestCommand(Object id, boolean parallelStream, org.infinispan.stream.impl.StreamRequestCommand.Type type, IntSet segments, Set<K> keys, Set<K> excludedKeys, boolean includeLoader, boolean entryStream, Object terminalOperation)
<R> org.infinispan.stream.impl.StreamResponseCommand<R>
buildStreamResponseCommand(Object identifier, boolean complete, IntSet lostSegments, R response)
BuildsStreamResponseCommand
used to send back a response either intermediate or complete to the originating node with the information for the stream request.org.infinispan.expiration.impl.TouchCommand
buildTouchCommand(Object key, int segment)
TxCompletionNotificationCommand
buildTxCompletionNotificationCommand(long internalId)
TxCompletionNotificationCommand
buildTxCompletionNotificationCommand(Xid xid, GlobalTransaction globalTransaction)
Builds aTxCompletionNotificationCommand
.VersionedCommitCommand
buildVersionedCommitCommand(GlobalTransaction gtx)
Builds a VersionedCommitCommandVersionedPrepareCommand
buildVersionedPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhase)
Builds a VersionedPrepareCommand<K,V>
WriteOnlyKeyCommand<K,V>buildWriteOnlyKeyCommand(Object key, Consumer<EntryView.WriteEntryView<K,V>> f, int segment, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,T>
WriteOnlyKeyValueCommand<K,V,T>buildWriteOnlyKeyValueCommand(Object key, Object argument, BiConsumer<T,EntryView.WriteEntryView<K,V>> f, int segment, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V>
WriteOnlyManyCommand<K,V>buildWriteOnlyManyCommand(Collection<?> keys, Consumer<EntryView.WriteEntryView<K,V>> f, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,T>
WriteOnlyManyEntriesCommand<K,V,T>buildWriteOnlyManyEntriesCommand(Map<?,?> arguments, BiConsumer<T,EntryView.WriteEntryView<K,V>> f, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
XSiteAdminCommand
buildXSiteAdminCommand(String siteName, XSiteAdminCommand.AdminOperation op, Integer afterFailures, Long minTimeToWait)
Builds XSiteAdminCommand used to perform system administrator operations.XSiteStatePushCommand
buildXSiteStatePushCommand(XSiteState[] chunk, long timeoutMillis)
Builds XSiteStatePushCommand used to transfer a single chunk of data between sites.XSiteStateTransferControlCommand
buildXSiteStateTransferControlCommand(XSiteStateTransferControlCommand.StateTransferControl control, String siteName)
Builds XSiteStateTransferControlCommand used to control the-cross site state transfer.String
getCacheName()
Retrieves the cache name this CommandFactory is set up to construct commands for.void
initializeReplicableCommand(ReplicableCommand c, boolean isRemote)
Initializes aReplicableCommand
read from a data stream with components specific to the target cache instance.void
start()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.CommandsFactory
buildApplyDeltaCommand
-
-
-
-
Method Detail
-
start
public void start()
-
buildPutKeyValueCommand
public PutKeyValueCommand buildPutKeyValueCommand(Object key, Object value, int segment, Metadata metadata, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a PutKeyValueCommand- Specified by:
buildPutKeyValueCommand
in interfaceCommandsFactory
- Parameters:
key
- key to putvalue
- value to putsegment
- the segment of the given keymetadata
- metadata of entryflagsBitSet
- Command flags provided by cache- Returns:
- a PutKeyValueCommand
-
buildRemoveCommand
public RemoveCommand buildRemoveCommand(Object key, Object value, int segment, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a RemoveCommand- Specified by:
buildRemoveCommand
in interfaceCommandsFactory
- Parameters:
key
- key to removevalue
- value to check for ina conditional remove, or null for an unconditional remove.segment
- the segment of the given keyflagsBitSet
- Command flags provided by cache- Returns:
- a RemoveCommand
-
buildInvalidateCommand
public InvalidateCommand buildInvalidateCommand(long flagsBitSet, Object... keys)
Description copied from interface:CommandsFactory
Builds an InvalidateCommand- Specified by:
buildInvalidateCommand
in interfaceCommandsFactory
- Parameters:
flagsBitSet
- Command flags provided by cachekeys
- keys to invalidate- Returns:
- an InvalidateCommand
-
buildInvalidateFromL1Command
public InvalidateCommand buildInvalidateFromL1Command(long flagsBitSet, Collection<Object> keys)
Description copied from interface:CommandsFactory
Builds an InvalidateFromL1Command- Specified by:
buildInvalidateFromL1Command
in interfaceCommandsFactory
- Parameters:
flagsBitSet
- Command flags provided by cachekeys
- keys to invalidate- Returns:
- an InvalidateFromL1Command
-
buildInvalidateFromL1Command
public InvalidateCommand buildInvalidateFromL1Command(Address origin, long flagsBitSet, Collection<Object> keys)
- Specified by:
buildInvalidateFromL1Command
in interfaceCommandsFactory
- See Also:
CommandsFactory.buildInvalidateFromL1Command(long, Collection)
-
buildRemoveExpiredCommand
public RemoveExpiredCommand buildRemoveExpiredCommand(Object key, Object value, int segment, Long lifespan, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds an expired remove command that is used to remove only a specific entry when it expires via lifespan- Specified by:
buildRemoveExpiredCommand
in interfaceCommandsFactory
- Parameters:
key
- the key of the expired entryvalue
- the value of the entry when it was expiredsegment
- the segment of the given keylifespan
- the lifespan that expired from the commandflagsBitSet
- Command flags provided by cache- Returns:
- a RemovedExpiredCommand
-
buildRemoveExpiredCommand
public RemoveExpiredCommand buildRemoveExpiredCommand(Object key, Object value, int segment, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds an expired remove command that is used to remove only a specific entry when it expires via maxIdle- Specified by:
buildRemoveExpiredCommand
in interfaceCommandsFactory
- Parameters:
key
- the key of the expired entryvalue
- the value of the entry when it was expiredsegment
- the segment of the given keyflagsBitSet
- Command flags provided by cache- Returns:
- a RemovedExpiredCommand
-
buildReplaceCommand
public ReplaceCommand buildReplaceCommand(Object key, Object oldValue, Object newValue, int segment, Metadata metadata, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a ReplaceCommand- Specified by:
buildReplaceCommand
in interfaceCommandsFactory
- Parameters:
key
- key to replaceoldValue
- existing value to check for if conditional, null if unconditional.newValue
- value to replace withsegment
- the segment of the given keymetadata
- metadata of entryflagsBitSet
- Command flags provided by cache- Returns:
- a ReplaceCommand
-
buildComputeCommand
public ComputeCommand buildComputeCommand(Object key, BiFunction mappingFunction, boolean computeIfPresent, int segment, Metadata metadata, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a ComputeCommand- Specified by:
buildComputeCommand
in interfaceCommandsFactory
- Parameters:
key
- key to compute if this key is absentmappingFunction
- BiFunction for the key and the valuecomputeIfPresent
- flag to apply as computeIfPresent modesegment
- the segment of the given keymetadata
- metadata of entryflagsBitSet
- Command flags provided by cache- Returns:
- a ComputeCommand
-
buildComputeIfAbsentCommand
public ComputeIfAbsentCommand buildComputeIfAbsentCommand(Object key, Function mappingFunction, int segment, Metadata metadata, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a ComputeIfAbsentCommand- Specified by:
buildComputeIfAbsentCommand
in interfaceCommandsFactory
- Parameters:
key
- key to compute if this key is absentmappingFunction
- mappingFunction for the keysegment
- the segment of the given keymetadata
- metadata of entryflagsBitSet
- Command flags provided by cache- Returns:
- a ComputeCommand
-
buildSizeCommand
public SizeCommand buildSizeCommand(long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a SizeCommand- Specified by:
buildSizeCommand
in interfaceCommandsFactory
- Parameters:
flagsBitSet
- Command flags provided by cache- Returns:
- a SizeCommand
-
buildKeySetCommand
public KeySetCommand buildKeySetCommand(long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a KeySetCommand- Specified by:
buildKeySetCommand
in interfaceCommandsFactory
- Parameters:
flagsBitSet
- Command flags provided by cache- Returns:
- a KeySetCommand
-
buildEntrySetCommand
public EntrySetCommand buildEntrySetCommand(long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a EntrySetCommand- Specified by:
buildEntrySetCommand
in interfaceCommandsFactory
- Parameters:
flagsBitSet
- Command flags provided by cache- Returns:
- a EntrySetCommand
-
buildGetKeyValueCommand
public GetKeyValueCommand buildGetKeyValueCommand(Object key, int segment, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a GetKeyValueCommand- Specified by:
buildGetKeyValueCommand
in interfaceCommandsFactory
- Parameters:
key
- key to getsegment
- the segment of the given keyflagsBitSet
- Command flags provided by cache- Returns:
- a GetKeyValueCommand
-
buildGetAllCommand
public GetAllCommand buildGetAllCommand(Collection<?> keys, long flagsBitSet, boolean returnEntries)
Description copied from interface:CommandsFactory
Builds a GetAllCommand- Specified by:
buildGetAllCommand
in interfaceCommandsFactory
- Parameters:
keys
- keys to getflagsBitSet
- Command flags provided by cachereturnEntries
- boolean indicating whether entire cache entries are returned, otherwise return just the value parts- Returns:
- a GetKeyValueCommand
-
buildPutMapCommand
public PutMapCommand buildPutMapCommand(Map<?,?> map, Metadata metadata, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a PutMapCommand- Specified by:
buildPutMapCommand
in interfaceCommandsFactory
- Parameters:
map
- map containing key/value entries to putmetadata
- metadata of entryflagsBitSet
- Command flags provided by cache- Returns:
- a PutMapCommand
-
buildClearCommand
public ClearCommand buildClearCommand(long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a ClearCommand- Specified by:
buildClearCommand
in interfaceCommandsFactory
- Parameters:
flagsBitSet
- Command flags provided by cache- Returns:
- a ClearCommand
-
buildEvictCommand
public EvictCommand buildEvictCommand(Object key, int segment, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds an EvictCommand- Specified by:
buildEvictCommand
in interfaceCommandsFactory
- Parameters:
key
- key to evictsegment
- the segment for the keyflagsBitSet
- Command flags provided by cache- Returns:
- an EvictCommand
-
buildPrepareCommand
public PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhaseCommit)
Description copied from interface:CommandsFactory
Builds a PrepareCommand- Specified by:
buildPrepareCommand
in interfaceCommandsFactory
- Parameters:
gtx
- global transaction associated with the preparemodifications
- list of modificationsonePhaseCommit
- is this a one-phase or two-phase transaction?- Returns:
- a PrepareCommand
-
buildVersionedPrepareCommand
public VersionedPrepareCommand buildVersionedPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhase)
Description copied from interface:CommandsFactory
Builds a VersionedPrepareCommand- Specified by:
buildVersionedPrepareCommand
in interfaceCommandsFactory
- Parameters:
gtx
- global transaction associated with the preparemodifications
- list of modifications- Returns:
- a VersionedPrepareCommand
-
buildCommitCommand
public CommitCommand buildCommitCommand(GlobalTransaction gtx)
Description copied from interface:CommandsFactory
Builds a CommitCommand- Specified by:
buildCommitCommand
in interfaceCommandsFactory
- Parameters:
gtx
- global transaction associated with the commit- Returns:
- a CommitCommand
-
buildVersionedCommitCommand
public VersionedCommitCommand buildVersionedCommitCommand(GlobalTransaction gtx)
Description copied from interface:CommandsFactory
Builds a VersionedCommitCommand- Specified by:
buildVersionedCommitCommand
in interfaceCommandsFactory
- Parameters:
gtx
- global transaction associated with the commit- Returns:
- a VersionedCommitCommand
-
buildRollbackCommand
public RollbackCommand buildRollbackCommand(GlobalTransaction gtx)
Description copied from interface:CommandsFactory
Builds a RollbackCommand- Specified by:
buildRollbackCommand
in interfaceCommandsFactory
- Parameters:
gtx
- global transaction associated with the rollback- Returns:
- a RollbackCommand
-
buildSingleRpcCommand
public SingleRpcCommand buildSingleRpcCommand(ReplicableCommand call)
Description copied from interface:CommandsFactory
Builds a SingleRpcCommand "envelope" containing a single ReplicableCommand- Specified by:
buildSingleRpcCommand
in interfaceCommandsFactory
- Parameters:
call
- ReplicableCommand to include in the envelope- Returns:
- a SingleRpcCommand
-
buildClusteredGetCommand
public ClusteredGetCommand buildClusteredGetCommand(Object key, int segment, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a ClusteredGetCommand, which is a remote lookup command- Specified by:
buildClusteredGetCommand
in interfaceCommandsFactory
- Parameters:
key
- key to look upsegment
- the segment for the keyflagsBitSet
- Command flags provided by cache- Returns:
- a ClusteredGetCommand
-
initializeReplicableCommand
public void initializeReplicableCommand(ReplicableCommand c, boolean isRemote)
Description copied from interface:CommandsFactory
Initializes aReplicableCommand
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.- Specified by:
initializeReplicableCommand
in interfaceCommandsFactory
- Parameters:
isRemote
- true if the command is deserialized and is executed remote.c
- command to initialize. Cannot be null.
-
buildLockControlCommand
public LockControlCommand buildLockControlCommand(Collection<?> keys, long flagsBitSet, GlobalTransaction gtx)
Description copied from interface:CommandsFactory
Builds a LockControlCommand to control explicit remote locking- Specified by:
buildLockControlCommand
in interfaceCommandsFactory
- Parameters:
keys
- keys to lockflagsBitSet
- Command flags provided by cache- Returns:
- a LockControlCommand
-
buildLockControlCommand
public LockControlCommand buildLockControlCommand(Object key, long flagsBitSet, GlobalTransaction gtx)
Description copied from interface:CommandsFactory
Same asCommandsFactory.buildLockControlCommand(Object, long, GlobalTransaction)
but for locking a single key vs a collection of keys.- Specified by:
buildLockControlCommand
in interfaceCommandsFactory
-
buildLockControlCommand
public LockControlCommand buildLockControlCommand(Collection<?> keys, long flagsBitSet)
- Specified by:
buildLockControlCommand
in interfaceCommandsFactory
-
buildStateRequestCommand
public StateRequestCommand buildStateRequestCommand(StateRequestCommand.Type subtype, Address sender, int topologyId, IntSet segments)
Description copied from interface:CommandsFactory
Builds a StateRequestCommand used for requesting transactions and locks and for starting or canceling transfer of cache entries.- Specified by:
buildStateRequestCommand
in interfaceCommandsFactory
-
buildStateResponseCommand
public StateResponseCommand buildStateResponseCommand(Address sender, int topologyId, Collection<StateChunk> stateChunks, boolean applyState, boolean pushTransfer)
Description copied from interface:CommandsFactory
Builds a StateResponseCommand used for pushing cache entries to another node in response to a StateRequestCommand.- Specified by:
buildStateResponseCommand
in interfaceCommandsFactory
-
getCacheName
public String getCacheName()
Description copied from interface:CommandsFactory
Retrieves the cache name this CommandFactory is set up to construct commands for.- Specified by:
getCacheName
in interfaceCommandsFactory
- Returns:
- the name of the cache this CommandFactory is set up to construct commands for.
-
buildGetInDoubtTransactionsCommand
public GetInDoubtTransactionsCommand buildGetInDoubtTransactionsCommand()
Description copied from interface:CommandsFactory
Builds aGetInDoubtTransactionsCommand
.- Specified by:
buildGetInDoubtTransactionsCommand
in interfaceCommandsFactory
-
buildTxCompletionNotificationCommand
public TxCompletionNotificationCommand buildTxCompletionNotificationCommand(Xid xid, GlobalTransaction globalTransaction)
Description copied from interface:CommandsFactory
Builds aTxCompletionNotificationCommand
.- Specified by:
buildTxCompletionNotificationCommand
in interfaceCommandsFactory
-
buildTxCompletionNotificationCommand
public TxCompletionNotificationCommand buildTxCompletionNotificationCommand(long internalId)
- Specified by:
buildTxCompletionNotificationCommand
in interfaceCommandsFactory
- Parameters:
internalId
- the internal id identifying the transaction to be removed.- See Also:
TxCompletionNotificationCommand
-
buildDistributedExecuteCommand
public <T> DistributedExecuteCommand<T> buildDistributedExecuteCommand(Callable<T> callable, Address sender, Collection keys)
Description copied from interface:CommandsFactory
Builds a DistributedExecuteCommand used for migration and execution of distributed Callables and Runnables.- Specified by:
buildDistributedExecuteCommand
in interfaceCommandsFactory
- Parameters:
callable
- the callable tasksender
- sender's Addresskeys
- keys used in Callable- Returns:
- a DistributedExecuteCommand
-
buildGetInDoubtTxInfoCommand
public GetInDoubtTxInfoCommand buildGetInDoubtTxInfoCommand()
- Specified by:
buildGetInDoubtTxInfoCommand
in interfaceCommandsFactory
- See Also:
GetInDoubtTxInfoCommand
-
buildCompleteTransactionCommand
public CompleteTransactionCommand buildCompleteTransactionCommand(Xid xid, boolean commit)
Description copied from interface:CommandsFactory
Builds a CompleteTransactionCommand command.- Specified by:
buildCompleteTransactionCommand
in interfaceCommandsFactory
- Parameters:
xid
- the xid identifying the transaction we want to complete.commit
- commit(true) or rollback(false)?
-
buildCreateCacheCommand
public CreateCacheCommand buildCreateCacheCommand(String cacheNameToCreate, String cacheConfigurationName)
Description copied from interface:CommandsFactory
Same asbuildCreateCacheCommand(cacheName, cacheConfigurationName, false, 0)
.- Specified by:
buildCreateCacheCommand
in interfaceCommandsFactory
-
buildCreateCacheCommand
public CreateCacheCommand buildCreateCacheCommand(String cacheNameToCreate, String cacheConfigurationName, int size)
Description copied from interface:CommandsFactory
Builds a CreateCacheCommand used to create/start cache around Infinispan cluster- Specified by:
buildCreateCacheCommand
in interfaceCommandsFactory
size
- Ifsize > 0
, the command will wait until the cache runs on at leastsize
nodes.
-
buildCancelCommandCommand
public CancelCommand buildCancelCommandCommand(UUID commandUUID)
Description copied from interface:CommandsFactory
Builds CancelCommandCommand used to cancel other commands executing on Infinispan cluster- Specified by:
buildCancelCommandCommand
in interfaceCommandsFactory
- Parameters:
commandUUID
- UUID for command to cancel- Returns:
- created CancelCommandCommand
-
buildXSiteStateTransferControlCommand
public XSiteStateTransferControlCommand buildXSiteStateTransferControlCommand(XSiteStateTransferControlCommand.StateTransferControl control, String siteName)
Description copied from interface:CommandsFactory
Builds XSiteStateTransferControlCommand used to control the-cross site state transfer.- Specified by:
buildXSiteStateTransferControlCommand
in interfaceCommandsFactory
- Parameters:
control
- the control operationsiteName
- the site name, needed for some control operations.- Returns:
- the XSiteStateTransferControlCommand created
-
buildXSiteAdminCommand
public XSiteAdminCommand buildXSiteAdminCommand(String siteName, XSiteAdminCommand.AdminOperation op, Integer afterFailures, Long minTimeToWait)
Description copied from interface:CommandsFactory
Builds XSiteAdminCommand used to perform system administrator operations.- Specified by:
buildXSiteAdminCommand
in interfaceCommandsFactory
- Returns:
- the XSiteAdminCommand created
-
buildXSiteStatePushCommand
public XSiteStatePushCommand buildXSiteStatePushCommand(XSiteState[] chunk, long timeoutMillis)
Description copied from interface:CommandsFactory
Builds XSiteStatePushCommand used to transfer a single chunk of data between sites.- Specified by:
buildXSiteStatePushCommand
in interfaceCommandsFactory
- Parameters:
chunk
- the data chunktimeoutMillis
- timeout in milliseconds, for the retries in the receiver site.- Returns:
- the XSiteStatePushCommand created
-
buildSingleXSiteRpcCommand
public SingleXSiteRpcCommand buildSingleXSiteRpcCommand(VisitableCommand command)
Description copied from interface:CommandsFactory
Builds SingleRpcCommand used to performVisitableCommand
on the backup site,- Specified by:
buildSingleXSiteRpcCommand
in interfaceCommandsFactory
- Parameters:
command
- the visitable command.- Returns:
- the SingleXSiteRpcCommand created
-
buildGetKeysInGroupCommand
public GetKeysInGroupCommand buildGetKeysInGroupCommand(long flagsBitSet, Object groupName)
Description copied from interface:CommandsFactory
BuildsGetKeysInGroupCommand
used to fetch all the keys belonging to a group.- Specified by:
buildGetKeysInGroupCommand
in interfaceCommandsFactory
- Parameters:
flagsBitSet
- Command flags provided by cachegroupName
- the group name.- Returns:
- the GetKeysInGroup created.
-
buildStreamRequestCommand
public <K> org.infinispan.stream.impl.StreamRequestCommand<K> buildStreamRequestCommand(Object id, boolean parallelStream, org.infinispan.stream.impl.StreamRequestCommand.Type type, IntSet segments, Set<K> keys, Set<K> excludedKeys, boolean includeLoader, boolean entryStream, Object terminalOperation)
- Specified by:
buildStreamRequestCommand
in interfaceCommandsFactory
-
buildStreamResponseCommand
public <R> org.infinispan.stream.impl.StreamResponseCommand<R> buildStreamResponseCommand(Object identifier, boolean complete, IntSet lostSegments, R response)
Description copied from interface:CommandsFactory
BuildsStreamResponseCommand
used to send back a response either intermediate or complete to the originating node with the information for the stream request.- Specified by:
buildStreamResponseCommand
in interfaceCommandsFactory
- Type Parameters:
R
- type of response- Parameters:
identifier
- the unique identifier for the stream requestcomplete
- whether or not this is an intermediate or final response from this node for the given idlostSegments
- what segments that were lost during processingresponse
- the actual response- Returns:
- the command to send back the response
-
buildStreamIteratorRequestCommand
public <K> org.infinispan.stream.impl.StreamIteratorRequestCommand<K> buildStreamIteratorRequestCommand(Object id, boolean parallelStream, IntSet segments, Set<K> keys, Set<K> excludedKeys, boolean includeLoader, boolean entryStream, Iterable<org.infinispan.stream.impl.intops.IntermediateOperation> intOps, long batchSize)
- Specified by:
buildStreamIteratorRequestCommand
in interfaceCommandsFactory
-
buildStreamIteratorNextCommand
public org.infinispan.stream.impl.StreamIteratorNextCommand buildStreamIteratorNextCommand(Object id, long batchSize)
- Specified by:
buildStreamIteratorNextCommand
in interfaceCommandsFactory
-
buildStreamIteratorCloseCommand
public org.infinispan.stream.impl.StreamIteratorCloseCommand buildStreamIteratorCloseCommand(Object id)
- Specified by:
buildStreamIteratorCloseCommand
in interfaceCommandsFactory
-
buildGetCacheEntryCommand
public GetCacheEntryCommand buildGetCacheEntryCommand(Object key, int segment, long flagsBitSet)
Description copied from interface:CommandsFactory
Builds a GetCacheEntryCommand- Specified by:
buildGetCacheEntryCommand
in interfaceCommandsFactory
- Parameters:
key
- key to getsegment
- the segment for the keyflagsBitSet
- Command flags provided by cache- Returns:
- a GetCacheEntryCommand
-
buildClusteredGetAllCommand
public ClusteredGetAllCommand buildClusteredGetAllCommand(List<?> keys, long flagsBitSet, GlobalTransaction gtx)
Description copied from interface:CommandsFactory
Builds a ClusteredGetAllCommand, which is a remote lookup command- Specified by:
buildClusteredGetAllCommand
in interfaceCommandsFactory
- Parameters:
keys
- key to look upflagsBitSet
- Command flags provided by cache- Returns:
- a ClusteredGetAllCommand
-
buildReadOnlyKeyCommand
public <K,V,R> ReadOnlyKeyCommand<K,V,R> buildReadOnlyKeyCommand(Object key, Function<EntryView.ReadEntryView<K,V>,R> f, int segment, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
- Specified by:
buildReadOnlyKeyCommand
in interfaceCommandsFactory
-
buildReadOnlyManyCommand
public <K,V,R> ReadOnlyManyCommand<K,V,R> buildReadOnlyManyCommand(Collection<?> keys, Function<EntryView.ReadEntryView<K,V>,R> f, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
- Specified by:
buildReadOnlyManyCommand
in interfaceCommandsFactory
-
buildReadWriteKeyValueCommand
public <K,V,T,R> ReadWriteKeyValueCommand<K,V,T,R> buildReadWriteKeyValueCommand(Object key, Object argument, BiFunction<T,EntryView.ReadWriteEntryView<K,V>,R> f, int segment, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
- Specified by:
buildReadWriteKeyValueCommand
in interfaceCommandsFactory
-
buildReadWriteKeyCommand
public <K,V,R> ReadWriteKeyCommand<K,V,R> buildReadWriteKeyCommand(Object key, Function<EntryView.ReadWriteEntryView<K,V>,R> f, int segment, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
- Specified by:
buildReadWriteKeyCommand
in interfaceCommandsFactory
-
buildReadWriteManyCommand
public <K,V,R> ReadWriteManyCommand<K,V,R> buildReadWriteManyCommand(Collection<?> keys, Function<EntryView.ReadWriteEntryView<K,V>,R> f, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
- Specified by:
buildReadWriteManyCommand
in interfaceCommandsFactory
-
buildReadWriteManyEntriesCommand
public <K,V,T,R> ReadWriteManyEntriesCommand<K,V,T,R> buildReadWriteManyEntriesCommand(Map<?,?> entries, BiFunction<T,EntryView.ReadWriteEntryView<K,V>,R> f, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
- Specified by:
buildReadWriteManyEntriesCommand
in interfaceCommandsFactory
-
buildInvalidateVersionsCommand
public InvalidateVersionsCommand buildInvalidateVersionsCommand(int topologyId, Object[] keys, int[] topologyIds, long[] versions, boolean removed)
- Specified by:
buildInvalidateVersionsCommand
in interfaceCommandsFactory
-
buildWriteOnlyKeyCommand
public <K,V> WriteOnlyKeyCommand<K,V> buildWriteOnlyKeyCommand(Object key, Consumer<EntryView.WriteEntryView<K,V>> f, int segment, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
- Specified by:
buildWriteOnlyKeyCommand
in interfaceCommandsFactory
-
buildWriteOnlyKeyValueCommand
public <K,V,T> WriteOnlyKeyValueCommand<K,V,T> buildWriteOnlyKeyValueCommand(Object key, Object argument, BiConsumer<T,EntryView.WriteEntryView<K,V>> f, int segment, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
- Specified by:
buildWriteOnlyKeyValueCommand
in interfaceCommandsFactory
-
buildWriteOnlyManyCommand
public <K,V> WriteOnlyManyCommand<K,V> buildWriteOnlyManyCommand(Collection<?> keys, Consumer<EntryView.WriteEntryView<K,V>> f, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
- Specified by:
buildWriteOnlyManyCommand
in interfaceCommandsFactory
-
buildWriteOnlyManyEntriesCommand
public <K,V,T> WriteOnlyManyEntriesCommand<K,V,T> buildWriteOnlyManyEntriesCommand(Map<?,?> arguments, BiConsumer<T,EntryView.WriteEntryView<K,V>> f, org.infinispan.functional.impl.Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
- Specified by:
buildWriteOnlyManyEntriesCommand
in interfaceCommandsFactory
-
buildBackupAckCommand
public BackupAckCommand buildBackupAckCommand(long id, int topologyId)
- Specified by:
buildBackupAckCommand
in interfaceCommandsFactory
-
buildBackupMultiKeyAckCommand
public BackupMultiKeyAckCommand buildBackupMultiKeyAckCommand(long id, int segment, int topologyId)
- Specified by:
buildBackupMultiKeyAckCommand
in interfaceCommandsFactory
-
buildExceptionAckCommand
public ExceptionAckCommand buildExceptionAckCommand(long id, Throwable throwable, int topologyId)
- Specified by:
buildExceptionAckCommand
in interfaceCommandsFactory
-
buildRevokeBiasCommand
public RevokeBiasCommand buildRevokeBiasCommand(Address ackTarget, long id, int topologyId, Collection<Object> keys)
- Specified by:
buildRevokeBiasCommand
in interfaceCommandsFactory
-
buildRenewBiasCommand
public RenewBiasCommand buildRenewBiasCommand(Object[] keys)
- Specified by:
buildRenewBiasCommand
in interfaceCommandsFactory
-
buildSingleKeyBackupWriteCommand
public SingleKeyBackupWriteCommand buildSingleKeyBackupWriteCommand()
- Specified by:
buildSingleKeyBackupWriteCommand
in interfaceCommandsFactory
-
buildSingleKeyFunctionalBackupWriteCommand
public SingleKeyFunctionalBackupWriteCommand buildSingleKeyFunctionalBackupWriteCommand()
- Specified by:
buildSingleKeyFunctionalBackupWriteCommand
in interfaceCommandsFactory
-
buildPutMapBackupWriteCommand
public PutMapBackupWriteCommand buildPutMapBackupWriteCommand()
- Specified by:
buildPutMapBackupWriteCommand
in interfaceCommandsFactory
-
buildMultiEntriesFunctionalBackupWriteCommand
public MultiEntriesFunctionalBackupWriteCommand buildMultiEntriesFunctionalBackupWriteCommand()
- Specified by:
buildMultiEntriesFunctionalBackupWriteCommand
in interfaceCommandsFactory
-
buildMultiKeyFunctionalBackupWriteCommand
public MultiKeyFunctionalBackupWriteCommand buildMultiKeyFunctionalBackupWriteCommand()
- Specified by:
buildMultiKeyFunctionalBackupWriteCommand
in interfaceCommandsFactory
-
buildTouchCommand
public org.infinispan.expiration.impl.TouchCommand buildTouchCommand(Object key, int segment)
- Specified by:
buildTouchCommand
in interfaceCommandsFactory
-
-