public interface CommandsFactory
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
|
ClusteredGetAllCommand |
buildClusteredGetAllCommand(List<?> keys,
Set<Flag> flags,
GlobalTransaction gtx)
Builds a ClusteredGetAllCommand, which is a remote lookup command
|
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 cacheName,
String cacheConfigurationName)
Same as
buildCreateCacheCommand(cacheName, cacheConfigurationName, false, 0) . |
CreateCacheCommand |
buildCreateCacheCommand(String tmpCacheName,
String defaultTmpCacheConfigurationName,
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.
|
<K,V,C> EntryRequestCommand<K,V,C> |
buildEntryRequestCommand(UUID identifier,
Set<Integer> segments,
Set<K> keysToFilter,
KeyValueFilter<? super K,? super V> filter,
Converter<? super K,? super V,C> converter,
Set<Flag> flags)
Builds
EntryRequestCommand used to request entries from a remote node for
given segments |
<K,C> EntryResponseCommand<K,C> |
buildEntryResponseCommand(UUID identifier,
Set<Integer> completedSegments,
Set<Integer> inDoubtSegments,
Collection<CacheEntry<K,C>> values,
CacheException e)
Builds
EntryResponseCommand use to respond with retrieved entries for
given segments |
EntrySetCommand |
buildEntrySetCommand(Set<Flag> flags)
Builds a EntrySetCommand
|
EvictCommand |
buildEvictCommand(Object key,
Set<Flag> flags)
Builds an EvictCommand
|
GetAllCommand |
buildGetAllCommand(Collection<?> keys,
Set<Flag> flags,
boolean returnEntries)
Builds a GetAllCommand
|
GetCacheEntryCommand |
buildGetCacheEntryCommand(Object key,
Set<Flag> explicitFlags)
Builds a GetCacheEntryCommand
|
GetInDoubtTransactionsCommand |
buildGetInDoubtTransactionsCommand()
Builds a
GetInDoubtTransactionsCommand . |
GetInDoubtTxInfoCommand |
buildGetInDoubtTxInfoCommand() |
GetKeysInGroupCommand |
buildGetKeysInGroupCommand(Set<Flag> flags,
String groupName)
Builds
GetKeysInGroupCommand used to fetch all the keys belonging to a group. |
GetKeyValueCommand |
buildGetKeyValueCommand(Object key,
Set<Flag> flags)
Builds a GetKeyValueCommand
|
InvalidateCommand |
buildInvalidateCommand(Set<Flag> flags,
Object... keys)
Builds an InvalidateCommand
|
InvalidateCommand |
buildInvalidateFromL1Command(Address origin,
Set<Flag> flags,
Collection<Object> keys) |
InvalidateCommand |
buildInvalidateFromL1Command(Set<Flag> flags,
Collection<Object> keys)
Builds an InvalidateFromL1Command
|
KeySetCommand |
buildKeySetCommand(Set<Flag> flags)
Builds a KeySetCommand
|
LockControlCommand |
buildLockControlCommand(Collection<?> keys,
Set<Flag> flags) |
LockControlCommand |
buildLockControlCommand(Collection<?> 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
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
|
<K,V,R> ReadOnlyKeyCommand<K,V,R> |
buildReadOnlyKeyCommand(K key,
Function<EntryView.ReadEntryView<K,V>,R> f) |
<K,V,R> ReadOnlyManyCommand<K,V,R> |
buildReadOnlyManyCommand(Set<? extends K> keys,
Function<EntryView.ReadEntryView<K,V>,R> f) |
<K,V,R> ReadWriteKeyCommand<K,V,R> |
buildReadWriteKeyCommand(K key,
Function<EntryView.ReadWriteEntryView<K,V>,R> f,
Params params) |
<K,V,R> ReadWriteKeyValueCommand<K,V,R> |
buildReadWriteKeyValueCommand(K key,
V value,
BiFunction<V,EntryView.ReadWriteEntryView<K,V>,R> f,
Params params) |
<K,V,R> ReadWriteManyCommand<K,V,R> |
buildReadWriteManyCommand(Set<? extends K> keys,
Function<EntryView.ReadWriteEntryView<K,V>,R> f,
Params params) |
<K,V,R> ReadWriteManyEntriesCommand<K,V,R> |
buildReadWriteManyEntriesCommand(Map<? extends K,? extends V> entries,
BiFunction<V,EntryView.ReadWriteEntryView<K,V>,R> f,
Params params) |
<KOut,VOut> |
buildReduceCommand(String taskId,
String destinationCache,
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
|
RemoveExpiredCommand |
buildRemoveExpiredCommand(Object key,
Object value,
Long lifespan)
Builds an expired remove command that is used to remove only a specific expired entry
|
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
|
SingleXSiteRpcCommand |
buildSingleXSiteRpcCommand(VisitableCommand command)
Builds SingleRpcCommand used to perform
VisitableCommand on the backup site, |
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.
|
<K> StreamRequestCommand<K> |
buildStreamRequestCommand(Object id,
boolean parallelStream,
StreamRequestCommand.Type type,
Set<Integer> segments,
Set<K> keys,
Set<K> excludedKeys,
boolean includeLoader,
Object terminalOperation) |
<R> StreamResponseCommand<R> |
buildStreamResponseCommand(Object identifier,
boolean complete,
Set<Integer> lostSegments,
R response)
Builds
StreamResponseCommand used to send back a response either intermediate or complete to the
originating node with the information for the stream request. |
TxCompletionNotificationCommand |
buildTxCompletionNotificationCommand(long internalId) |
TxCompletionNotificationCommand |
buildTxCompletionNotificationCommand(Xid xid,
GlobalTransaction globalTransaction)
Builds a
TxCompletionNotificationCommand . |
VersionedCommitCommand |
buildVersionedCommitCommand(GlobalTransaction gtx)
Builds a VersionedCommitCommand
|
VersionedPrepareCommand |
buildVersionedPrepareCommand(GlobalTransaction gtx,
List<WriteCommand> modifications,
boolean onePhase)
Builds a VersionedPrepareCommand
|
<K,V> WriteOnlyKeyCommand<K,V> |
buildWriteOnlyKeyCommand(K key,
Consumer<EntryView.WriteEntryView<V>> f,
Params params) |
<K,V> WriteOnlyKeyValueCommand<K,V> |
buildWriteOnlyKeyValueCommand(K key,
V value,
BiConsumer<V,EntryView.WriteEntryView<V>> f,
Params params) |
<K,V> WriteOnlyManyCommand<K,V> |
buildWriteOnlyManyCommand(Set<? extends K> keys,
Consumer<EntryView.WriteEntryView<V>> f,
Params params) |
<K,V> WriteOnlyManyEntriesCommand<K,V> |
buildWriteOnlyManyEntriesCommand(Map<? extends K,? extends V> entries,
BiConsumer<V,EntryView.WriteEntryView<V>> f,
Params params) |
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 command,
boolean isRemote)
Initializes a
ReplicableCommand read from a data stream with components specific
to the target cache instance. |
PutKeyValueCommand buildPutKeyValueCommand(Object key, Object value, Metadata metadata, Set<Flag> flags)
key
- key to putvalue
- value to putmetadata
- metadata of entryflags
- Command flags provided by cacheRemoveCommand buildRemoveCommand(Object key, Object value, Set<Flag> flags)
key
- key to removevalue
- value to check for ina conditional remove, or null for an unconditional remove.flags
- Command flags provided by cacheInvalidateCommand buildInvalidateCommand(Set<Flag> flags, Object... keys)
flags
- Command flags provided by cachekeys
- keys to invalidateInvalidateCommand buildInvalidateFromL1Command(Set<Flag> flags, Collection<Object> keys)
keys
- keys to invalidateInvalidateCommand buildInvalidateFromL1Command(Address origin, Set<Flag> flags, Collection<Object> keys)
RemoveExpiredCommand buildRemoveExpiredCommand(Object key, Object value, Long lifespan)
key
- the key of the expired entryvalue
- the value of the entry when it was expiredlifespan
- the lifespan that expired from the commandReplaceCommand buildReplaceCommand(Object key, Object oldValue, Object newValue, Metadata metadata, Set<Flag> flags)
key
- 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 cacheSizeCommand buildSizeCommand(Set<Flag> flags)
flags
- Command flags provided by cacheGetKeyValueCommand buildGetKeyValueCommand(Object key, Set<Flag> flags)
key
- key to getflags
- Command flags provided by cacheGetCacheEntryCommand buildGetCacheEntryCommand(Object key, Set<Flag> explicitFlags)
key
- key to getexplicitFlags
- Command flags provided by cacheGetAllCommand buildGetAllCommand(Collection<?> keys, Set<Flag> flags, boolean returnEntries)
keys
- keys to getflags
- Command flags provided by cachereturnEntries
- boolean indicating whether entire cache entries are
returned, otherwise return just the value partsKeySetCommand buildKeySetCommand(Set<Flag> flags)
flags
- Command flags provided by cacheEntrySetCommand buildEntrySetCommand(Set<Flag> flags)
flags
- Command flags provided by cachePutMapCommand buildPutMapCommand(Map<?,?> map, Metadata metadata, Set<Flag> flags)
map
- map containing key/value entries to putmetadata
- metadata of entryflags
- Command flags provided by cacheClearCommand buildClearCommand(Set<Flag> flags)
flags
- Command flags provided by cacheEvictCommand buildEvictCommand(Object key, Set<Flag> flags)
key
- key to evictflags
- Command flags provided by cachePrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhaseCommit)
gtx
- global transaction associated with the preparemodifications
- list of modificationsonePhaseCommit
- is this a one-phase or two-phase transaction?VersionedPrepareCommand buildVersionedPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhase)
gtx
- global transaction associated with the preparemodifications
- list of modificationsonePhase
- CommitCommand buildCommitCommand(GlobalTransaction gtx)
gtx
- global transaction associated with the commitVersionedCommitCommand buildVersionedCommitCommand(GlobalTransaction gtx)
gtx
- global transaction associated with the commitRollbackCommand buildRollbackCommand(GlobalTransaction gtx)
gtx
- global transaction associated with the rollbackvoid initializeReplicableCommand(ReplicableCommand command, boolean isRemote)
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.
command
- command to initialize. Cannot be null.isRemote
- MultipleRpcCommand buildReplicateCommand(List<ReplicableCommand> toReplicate)
toReplicate
- ReplicableCommands to include in the envelopeSingleRpcCommand buildSingleRpcCommand(ReplicableCommand call)
call
- ReplicableCommand to include in the envelopeClusteredGetCommand buildClusteredGetCommand(Object key, Set<Flag> flags, boolean acquireRemoteLock, GlobalTransaction gtx)
key
- key to look upClusteredGetAllCommand buildClusteredGetAllCommand(List<?> keys, Set<Flag> flags, GlobalTransaction gtx)
keys
- key to look upLockControlCommand buildLockControlCommand(Collection<?> keys, Set<Flag> flags, GlobalTransaction gtx)
keys
- keys to lockgtx
- LockControlCommand buildLockControlCommand(Object key, Set<Flag> flags, GlobalTransaction gtx)
buildLockControlCommand(Object, java.util.Set, org.infinispan.transaction.xa.GlobalTransaction)
but for locking a single key vs a collection of keys.LockControlCommand buildLockControlCommand(Collection<?> keys, Set<Flag> flags)
StateRequestCommand buildStateRequestCommand(StateRequestCommand.Type subtype, Address sender, int viewId, Set<Integer> segments)
StateResponseCommand buildStateResponseCommand(Address sender, int viewId, Collection<StateChunk> stateChunks)
String getCacheName()
GetInDoubtTransactionsCommand buildGetInDoubtTransactionsCommand()
GetInDoubtTransactionsCommand
.TxCompletionNotificationCommand buildTxCompletionNotificationCommand(Xid xid, GlobalTransaction globalTransaction)
TxCompletionNotificationCommand
.<T> DistributedExecuteCommand<T> buildDistributedExecuteCommand(Callable<T> callable, Address sender, Collection keys)
callable
- the callable tasksender
- sender's Addresskeys
- keys used in Callable<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)
m
- Mapper for MapReduceTaskr
- Combiner for MapReduceTaskkeys
- keys used in MapReduceTask<KOut,VOut> ReduceCommand<KOut,VOut> buildReduceCommand(String taskId, String destinationCache, Reducer<KOut,VOut> r, Collection<KOut> keys)
r
- Reducer for MapReduceTaskkeys
- keys used in MapReduceTaskGetInDoubtTxInfoCommand buildGetInDoubtTxInfoCommand()
GetInDoubtTxInfoCommand
CompleteTransactionCommand buildCompleteTransactionCommand(Xid xid, boolean commit)
xid
- the xid identifying the transaction we want to complete.commit
- commit(true) or rollback(false)?TxCompletionNotificationCommand buildTxCompletionNotificationCommand(long internalId)
internalId
- the internal id identifying the transaction to be removed.TxCompletionNotificationCommand
ApplyDeltaCommand buildApplyDeltaCommand(Object deltaAwareValueKey, Delta delta, Collection keys)
ApplyDeltaCommand
CreateCacheCommand buildCreateCacheCommand(String cacheName, String cacheConfigurationName)
buildCreateCacheCommand(cacheName, cacheConfigurationName, false, 0)
.CreateCacheCommand buildCreateCacheCommand(String tmpCacheName, String defaultTmpCacheConfigurationName, int size)
size
- If size > 0
, the command will wait until the cache runs on at least size
nodes.CancelCommand buildCancelCommandCommand(UUID commandUUID)
commandUUID
- UUID for command to cancelXSiteStateTransferControlCommand buildXSiteStateTransferControlCommand(XSiteStateTransferControlCommand.StateTransferControl control, String siteName)
control
- the control operationsiteName
- the site name, needed for some control operations.XSiteAdminCommand buildXSiteAdminCommand(String siteName, XSiteAdminCommand.AdminOperation op, Integer afterFailures, Long minTimeToWait)
XSiteStatePushCommand buildXSiteStatePushCommand(XSiteState[] chunk, long timeoutMillis)
chunk
- the data chunktimeoutMillis
- timeout in milliseconds, for the retries in the receiver site.SingleXSiteRpcCommand buildSingleXSiteRpcCommand(VisitableCommand command)
VisitableCommand
on the backup site,command
- the visitable command.<K,V,C> EntryRequestCommand<K,V,C> buildEntryRequestCommand(UUID identifier, Set<Integer> segments, Set<K> keysToFilter, KeyValueFilter<? super K,? super V> filter, Converter<? super K,? super V,C> converter, Set<Flag> flags)
EntryRequestCommand
used to request entries from a remote node for
given segmentsK
- The key type of the stored keyV
- The value type of the stored valuesC
- The converted type after the value is applied from the converteridentifier
- The unique identifier for this entry retrieval requestsegments
- The segments this request should retrievefilter
- The filter to apply to any found values to limit response dataconverter
- The converter to apply to any found valuesflags
- The flags used to modify behavior<K,C> EntryResponseCommand<K,C> buildEntryResponseCommand(UUID identifier, Set<Integer> completedSegments, Set<Integer> inDoubtSegments, Collection<CacheEntry<K,C>> values, CacheException e)
EntryResponseCommand
use to respond with retrieved entries for
given segmentsK
- The key type of the stored keyC
- The converted type after the value is applied from the converteridentifier
- The unique identifier for this entry retrieval requestcompletedSegments
- The segments that are now completed per this responseinDoubtSegments
- The segements that are now in doubt meaning they must be retrieved again from another
node due to rehashvalues
- The entries retrieved from the remote nodee
- If an exception occurred while running the processing on the remote nodeGetKeysInGroupCommand buildGetKeysInGroupCommand(Set<Flag> flags, String groupName)
GetKeysInGroupCommand
used to fetch all the keys belonging to a group.flags
- groupName
- the group name.<K> StreamRequestCommand<K> buildStreamRequestCommand(Object id, boolean parallelStream, StreamRequestCommand.Type type, Set<Integer> segments, Set<K> keys, Set<K> excludedKeys, boolean includeLoader, Object terminalOperation)
<R> StreamResponseCommand<R> buildStreamResponseCommand(Object identifier, boolean complete, Set<Integer> lostSegments, R response)
StreamResponseCommand
used to send back a response either intermediate or complete to the
originating node with the information for the stream request.R
- type of responseidentifier
- 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<K,V,R> ReadOnlyKeyCommand<K,V,R> buildReadOnlyKeyCommand(K key, Function<EntryView.ReadEntryView<K,V>,R> f)
<K,V,R> ReadOnlyManyCommand<K,V,R> buildReadOnlyManyCommand(Set<? extends K> keys, Function<EntryView.ReadEntryView<K,V>,R> f)
<K,V> WriteOnlyKeyCommand<K,V> buildWriteOnlyKeyCommand(K key, Consumer<EntryView.WriteEntryView<V>> f, Params params)
<K,V,R> ReadWriteKeyValueCommand<K,V,R> buildReadWriteKeyValueCommand(K key, V value, BiFunction<V,EntryView.ReadWriteEntryView<K,V>,R> f, Params params)
<K,V,R> ReadWriteKeyCommand<K,V,R> buildReadWriteKeyCommand(K key, Function<EntryView.ReadWriteEntryView<K,V>,R> f, Params params)
<K,V> WriteOnlyManyEntriesCommand<K,V> buildWriteOnlyManyEntriesCommand(Map<? extends K,? extends V> entries, BiConsumer<V,EntryView.WriteEntryView<V>> f, Params params)
<K,V> WriteOnlyKeyValueCommand<K,V> buildWriteOnlyKeyValueCommand(K key, V value, BiConsumer<V,EntryView.WriteEntryView<V>> f, Params params)
<K,V> WriteOnlyManyCommand<K,V> buildWriteOnlyManyCommand(Set<? extends K> keys, Consumer<EntryView.WriteEntryView<V>> f, Params params)
<K,V,R> ReadWriteManyCommand<K,V,R> buildReadWriteManyCommand(Set<? extends K> keys, Function<EntryView.ReadWriteEntryView<K,V>,R> f, Params params)
<K,V,R> ReadWriteManyEntriesCommand<K,V,R> buildReadWriteManyEntriesCommand(Map<? extends K,? extends V> entries, BiFunction<V,EntryView.ReadWriteEntryView<K,V>,R> f, Params params)
Copyright © 2020 JBoss, a division of Red Hat. All rights reserved.