public interface CommandsFactory
Commands returned by the various build*Command methods should be initialised sufficiently for local execution via the
interceptor chain, with no calls to initializeReplicableCommand(ReplicableCommand, boolean)
required.
However, for remote execution, it's assumed that a command will be initialized via initializeReplicableCommand(ReplicableCommand, boolean)
before being invoked.
Note, InitializableCommand
implementations should not rely on access to the ComponentRegistry
in their constructors for local execution initialization as this leads to
duplicated code. Instead implementations of this interface should call InitializableCommand.init(ComponentRegistry,
boolean)
before returning the created command.
PutKeyValueCommand buildPutKeyValueCommand(Object key, Object value, int segment, Metadata metadata, long flagsBitSet)
key
- key to putvalue
- value to putsegment
- the segment of the given keymetadata
- metadata of entryflagsBitSet
- Command flags provided by cacheRemoveCommand buildRemoveCommand(Object key, Object value, int segment, long flagsBitSet)
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 cacheInvalidateCommand buildInvalidateCommand(long flagsBitSet, Object... keys)
flagsBitSet
- Command flags provided by cachekeys
- keys to invalidateInvalidateCommand buildInvalidateFromL1Command(long flagsBitSet, Collection<Object> keys)
flagsBitSet
- Command flags provided by cachekeys
- keys to invalidateInvalidateCommand buildInvalidateFromL1Command(Address origin, long flagsBitSet, Collection<Object> keys)
RemoveExpiredCommand buildRemoveExpiredCommand(Object key, Object value, int segment, Long lifespan, long flagsBitSet)
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 cacheRemoveExpiredCommand buildRemoveExpiredCommand(Object key, Object value, int segment, long flagsBitSet)
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 cacheReplaceCommand buildReplaceCommand(Object key, Object oldValue, Object newValue, int segment, Metadata metadata, long flagsBitSet)
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 cacheComputeCommand buildComputeCommand(Object key, BiFunction mappingFunction, boolean computeIfPresent, int segment, Metadata metadata, long flagsBitSet)
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 cacheComputeIfAbsentCommand buildComputeIfAbsentCommand(Object key, Function mappingFunction, int segment, Metadata metadata, long flagsBitSet)
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 cacheSizeCommand buildSizeCommand(long flagsBitSet)
flagsBitSet
- Command flags provided by cacheGetKeyValueCommand buildGetKeyValueCommand(Object key, int segment, long flagsBitSet)
key
- key to getsegment
- the segment of the given keyflagsBitSet
- Command flags provided by cacheGetCacheEntryCommand buildGetCacheEntryCommand(Object key, int segment, long flagsBitSet)
key
- key to getsegment
- the segment for the keyflagsBitSet
- Command flags provided by cacheGetAllCommand buildGetAllCommand(Collection<?> keys, long flagsBitSet, boolean returnEntries)
keys
- keys to getflagsBitSet
- Command flags provided by cachereturnEntries
- boolean indicating whether entire cache entries are
returned, otherwise return just the value partsKeySetCommand buildKeySetCommand(long flagsBitSet)
flagsBitSet
- Command flags provided by cacheEntrySetCommand buildEntrySetCommand(long flagsBitSet)
flagsBitSet
- Command flags provided by cachePutMapCommand buildPutMapCommand(Map<?,?> map, Metadata metadata, long flagsBitSet)
map
- map containing key/value entries to putmetadata
- metadata of entryflagsBitSet
- Command flags provided by cacheClearCommand buildClearCommand(long flagsBitSet)
flagsBitSet
- Command flags provided by cacheEvictCommand buildEvictCommand(Object key, int segment, long flagsBitSet)
key
- key to evictsegment
- the segment for the keyflagsBitSet
- 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 rollback@Deprecated void initializeReplicableCommand(ReplicableCommand command, boolean isRemote)
CacheRpcCommand.invokeAsync(ComponentRegistry)
or GlobalRpcCommand.invokeAsync(GlobalComponentRegistry)
instead.
to access any components required at invocation time.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
- @Deprecated default SingleRpcCommand buildSingleRpcCommand(ReplicableCommand call)
buildSingleRpcCommand(VisitableCommand)
instead.call
- ReplicableCommand to include in the envelopeSingleRpcCommand buildSingleRpcCommand(VisitableCommand command)
command
- VisitableCommand to include in the envelopeClusteredGetCommand buildClusteredGetCommand(Object key, int segment, long flagsBitSet)
key
- key to look upsegment
- the segment for the keyflagsBitSet
- Command flags provided by cacheClusteredGetAllCommand buildClusteredGetAllCommand(List<?> keys, long flagsBitSet, GlobalTransaction gtx)
keys
- key to look upflagsBitSet
- Command flags provided by cacheLockControlCommand buildLockControlCommand(Collection<?> keys, long flagsBitSet, GlobalTransaction gtx)
keys
- keys to lockflagsBitSet
- Command flags provided by cachegtx
- LockControlCommand buildLockControlCommand(Object key, long flagsBitSet, GlobalTransaction gtx)
buildLockControlCommand(Object, long, GlobalTransaction)
but for locking a single key vs a collection of keys.LockControlCommand buildLockControlCommand(Collection<?> keys, long flagsBitSet)
ConflictResolutionStartCommand buildConflictResolutionStartCommand(int topologyId, IntSet segments)
StateTransferCancelCommand buildStateTransferCancelCommand(int topologyId, IntSet segments)
StateTransferGetListenersCommand buildStateTransferGetListenersCommand(int topologyId)
StateTransferGetTransactionsCommand buildStateTransferGetTransactionsCommand(int topologyId, IntSet segments)
StateTransferStartCommand buildStateTransferStartCommand(int topologyId, IntSet segments)
ScatteredStateGetKeysCommand buildScatteredStateGetKeysCommand(int topologyId, IntSet segments)
ScatteredStateConfirmRevokedCommand buildScatteredStateConfirmRevokeCommand(int topologyId, IntSet segments)
StateResponseCommand buildStateResponseCommand(int viewId, Collection<StateChunk> stateChunks, boolean applyState, boolean pushTransfer)
String getCacheName()
GetInDoubtTransactionsCommand buildGetInDoubtTransactionsCommand()
GetInDoubtTransactionsCommand
.TxCompletionNotificationCommand buildTxCompletionNotificationCommand(XidImpl xid, GlobalTransaction globalTransaction)
TxCompletionNotificationCommand
.GetInDoubtTxInfoCommand buildGetInDoubtTxInfoCommand()
GetInDoubtTxInfoCommand
CompleteTransactionCommand buildCompleteTransactionCommand(XidImpl 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
XSiteStateTransferCancelSendCommand buildXSiteStateTransferCancelSendCommand(String siteName)
XSiteStateTransferClearStatusCommand buildXSiteStateTransferClearStatusCommand()
XSiteStateTransferFinishReceiveCommand buildXSiteStateTransferFinishReceiveCommand(String siteName)
XSiteStateTransferFinishSendCommand buildXSiteStateTransferFinishSendCommand(String siteName, boolean statusOk)
XSiteStateTransferRestartSendingCommand buildXSiteStateTransferRestartSendingCommand(String siteName, int topologyId)
XSiteStateTransferStartReceiveCommand buildXSiteStateTransferStartReceiveCommand(String siteName)
XSiteStateTransferStartSendCommand buildXSiteStateTransferStartSendCommand(String siteName, int topologyId)
XSiteStateTransferStatusRequestCommand buildXSiteStateTransferStatusRequestCommand()
XSiteAmendOfflineStatusCommand buildXSiteAmendOfflineStatusCommand(String siteName, Integer afterFailures, Long minTimeToWait)
XSiteBringOnlineCommand buildXSiteBringOnlineCommand(String siteName)
XSiteOfflineStatusCommand buildXSiteOfflineStatusCommand(String siteName)
XSiteStatusCommand buildXSiteStatusCommand()
XSiteTakeOfflineCommand buildXSiteTakeOfflineCommand(String siteName)
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.GetKeysInGroupCommand buildGetKeysInGroupCommand(long flagsBitSet, Object groupName)
GetKeysInGroupCommand
used to fetch all the keys belonging to a group.flagsBitSet
- Command flags provided by cachegroupName
- the group name.<K,V,R> ReadOnlyKeyCommand<K,V,R> buildReadOnlyKeyCommand(Object key, Function<EntryView.ReadEntryView<K,V>,R> f, int segment, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,R> ReadOnlyManyCommand<K,V,R> buildReadOnlyManyCommand(Collection<?> keys, Function<EntryView.ReadEntryView<K,V>,R> f, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V> WriteOnlyKeyCommand<K,V> buildWriteOnlyKeyCommand(Object key, Consumer<EntryView.WriteEntryView<K,V>> f, int segment, 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, 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, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,T> WriteOnlyManyEntriesCommand<K,V,T> buildWriteOnlyManyEntriesCommand(Map<?,?> arguments, BiConsumer<T,EntryView.WriteEntryView<K,V>> f, 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, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V> WriteOnlyManyCommand<K,V> buildWriteOnlyManyCommand(Collection<?> keys, Consumer<EntryView.WriteEntryView<K,V>> f, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,R> ReadWriteManyCommand<K,V,R> buildReadWriteManyCommand(Collection<?> keys, Function<EntryView.ReadWriteEntryView<K,V>,R> f, 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, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,R> TxReadOnlyKeyCommand<K,V,R> buildTxReadOnlyKeyCommand(Object key, Function<EntryView.ReadEntryView<K,V>,R> f, List<Mutation<K,V,?>> mutations, int segment, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
<K,V,R> TxReadOnlyManyCommand<K,V,R> buildTxReadOnlyManyCommand(Collection<?> keys, List<List<Mutation<K,V,?>>> mutations, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
BackupAckCommand buildBackupAckCommand(long id, int topologyId)
BackupMultiKeyAckCommand buildBackupMultiKeyAckCommand(long id, int segment, int topologyId)
ExceptionAckCommand buildExceptionAckCommand(long id, Throwable throwable, int topologyId)
InvalidateVersionsCommand buildInvalidateVersionsCommand(int topologyId, Object[] keys, int[] topologyIds, long[] versions, boolean removed)
RevokeBiasCommand buildRevokeBiasCommand(Address ackTarget, long id, int topologyId, Collection<Object> keys)
RenewBiasCommand buildRenewBiasCommand(Object[] keys)
SingleKeyBackupWriteCommand buildSingleKeyBackupWriteCommand()
SingleKeyFunctionalBackupWriteCommand buildSingleKeyFunctionalBackupWriteCommand()
PutMapBackupWriteCommand buildPutMapBackupWriteCommand()
MultiEntriesFunctionalBackupWriteCommand buildMultiEntriesFunctionalBackupWriteCommand()
MultiKeyFunctionalBackupWriteCommand buildMultiKeyFunctionalBackupWriteCommand()
<K,R> ReductionPublisherRequestCommand<K> buildKeyReductionPublisherCommand(boolean parallelStream, DeliveryGuarantee deliveryGuarantee, IntSet segments, Set<K> keys, Set<K> excludedKeys, boolean includeLoader, Function<? super org.reactivestreams.Publisher<K>,? extends CompletionStage<R>> transformer, Function<? super org.reactivestreams.Publisher<R>,? extends CompletionStage<R>> finalizer)
<K,V,R> ReductionPublisherRequestCommand<K> buildEntryReductionPublisherCommand(boolean parallelStream, DeliveryGuarantee deliveryGuarantee, IntSet segments, Set<K> keys, Set<K> excludedKeys, boolean includeLoader, Function<? super org.reactivestreams.Publisher<CacheEntry<K,V>>,? extends CompletionStage<R>> transformer, Function<? super org.reactivestreams.Publisher<R>,? extends CompletionStage<R>> finalizer)
<K,I,R> InitialPublisherCommand<K,I,R> buildInitialPublisherCommand(String requestId, DeliveryGuarantee deliveryGuarantee, int batchSize, IntSet segments, Set<K> keys, Set<K> excludedKeys, boolean includeLoader, boolean entryStream, boolean trackKeys, Function<? super org.reactivestreams.Publisher<I>,? extends org.reactivestreams.Publisher<R>> transformer)
NextPublisherCommand buildNextPublisherCommand(String requestId)
CancelPublisherCommand buildCancelPublisherCommand(String requestId)
<K,V> MultiClusterEventCommand<K,V> buildMultiClusterEventCommand(Map<UUID,Collection<ClusterEvent<K,V>>> events)
CheckTransactionRpcCommand buildCheckTransactionRpcCommand(Collection<GlobalTransaction> globalTransactions)
TouchCommand buildTouchCommand(Object key, int segment)
<K,V> IracPutKeyCommand buildIracPutKeyCommand(InternalCacheEntry<K,V> entry)
IracRemoveKeyCommand buildIracRemoveKeyCommand(Object key, IracMetadata iracMetadata)
IracClearKeysCommand buildIracClearKeysCommand()
IracCleanupKeyCommand buildIracCleanupKeyCommand(Object key, Object lockOwner, IracMetadata tombstone)
IracMetadataRequestCommand buildIracMetadataRequestCommand(int segment)
IracRequestStateCommand buildIracRequestStateCommand(IntSet segments)
IracStateResponseCommand buildIracStateResponseCommand(Object key, Object lockOwner, IracMetadata tombstone)
Copyright © 2021 JBoss by Red Hat. All rights reserved.