public class CommandsFactoryImpl extends Object implements CommandsFactory
Constructor and Description |
---|
CommandsFactoryImpl() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildSingleRpcCommand
public void start()
public PutKeyValueCommand buildPutKeyValueCommand(Object key, Object value, int segment, Metadata metadata, long flagsBitSet)
CommandsFactory
buildPutKeyValueCommand
in interface CommandsFactory
key
- key to putvalue
- value to putsegment
- the segment of the given keymetadata
- metadata of entryflagsBitSet
- Command flags provided by cachepublic RemoveCommand buildRemoveCommand(Object key, Object value, int segment, long flagsBitSet)
CommandsFactory
buildRemoveCommand
in interface CommandsFactory
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 cachepublic InvalidateCommand buildInvalidateCommand(long flagsBitSet, Object... keys)
CommandsFactory
buildInvalidateCommand
in interface CommandsFactory
flagsBitSet
- Command flags provided by cachekeys
- keys to invalidatepublic InvalidateCommand buildInvalidateFromL1Command(long flagsBitSet, Collection<Object> keys)
CommandsFactory
buildInvalidateFromL1Command
in interface CommandsFactory
flagsBitSet
- Command flags provided by cachekeys
- keys to invalidatepublic InvalidateCommand buildInvalidateFromL1Command(Address origin, long flagsBitSet, Collection<Object> keys)
buildInvalidateFromL1Command
in interface CommandsFactory
CommandsFactory.buildInvalidateFromL1Command(long, Collection)
public RemoveExpiredCommand buildRemoveExpiredCommand(Object key, Object value, int segment, Long lifespan, long flagsBitSet)
CommandsFactory
buildRemoveExpiredCommand
in interface CommandsFactory
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 cachepublic RemoveExpiredCommand buildRemoveExpiredCommand(Object key, Object value, int segment, long flagsBitSet)
CommandsFactory
buildRemoveExpiredCommand
in interface CommandsFactory
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 cachepublic ReplaceCommand buildReplaceCommand(Object key, Object oldValue, Object newValue, int segment, Metadata metadata, long flagsBitSet)
CommandsFactory
buildReplaceCommand
in interface CommandsFactory
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 cachepublic ComputeCommand buildComputeCommand(Object key, BiFunction mappingFunction, boolean computeIfPresent, int segment, Metadata metadata, long flagsBitSet)
CommandsFactory
buildComputeCommand
in interface CommandsFactory
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 cachepublic ComputeIfAbsentCommand buildComputeIfAbsentCommand(Object key, Function mappingFunction, int segment, Metadata metadata, long flagsBitSet)
CommandsFactory
buildComputeIfAbsentCommand
in interface CommandsFactory
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 cachepublic SizeCommand buildSizeCommand(long flagsBitSet)
CommandsFactory
buildSizeCommand
in interface CommandsFactory
flagsBitSet
- Command flags provided by cachepublic KeySetCommand buildKeySetCommand(long flagsBitSet)
CommandsFactory
buildKeySetCommand
in interface CommandsFactory
flagsBitSet
- Command flags provided by cachepublic EntrySetCommand buildEntrySetCommand(long flagsBitSet)
CommandsFactory
buildEntrySetCommand
in interface CommandsFactory
flagsBitSet
- Command flags provided by cachepublic GetKeyValueCommand buildGetKeyValueCommand(Object key, int segment, long flagsBitSet)
CommandsFactory
buildGetKeyValueCommand
in interface CommandsFactory
key
- key to getsegment
- the segment of the given keyflagsBitSet
- Command flags provided by cachepublic GetAllCommand buildGetAllCommand(Collection<?> keys, long flagsBitSet, boolean returnEntries)
CommandsFactory
buildGetAllCommand
in interface CommandsFactory
keys
- keys to getflagsBitSet
- Command flags provided by cachereturnEntries
- boolean indicating whether entire cache entries are
returned, otherwise return just the value partspublic PutMapCommand buildPutMapCommand(Map<?,?> map, Metadata metadata, long flagsBitSet)
CommandsFactory
buildPutMapCommand
in interface CommandsFactory
map
- map containing key/value entries to putmetadata
- metadata of entryflagsBitSet
- Command flags provided by cachepublic ClearCommand buildClearCommand(long flagsBitSet)
CommandsFactory
buildClearCommand
in interface CommandsFactory
flagsBitSet
- Command flags provided by cachepublic EvictCommand buildEvictCommand(Object key, int segment, long flagsBitSet)
CommandsFactory
buildEvictCommand
in interface CommandsFactory
key
- key to evictsegment
- the segment for the keyflagsBitSet
- Command flags provided by cachepublic 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 modificationspublic CommitCommand buildCommitCommand(GlobalTransaction gtx)
CommandsFactory
buildCommitCommand
in interface CommandsFactory
gtx
- global transaction associated with the commitpublic VersionedCommitCommand buildVersionedCommitCommand(GlobalTransaction gtx)
CommandsFactory
buildVersionedCommitCommand
in interface CommandsFactory
gtx
- global transaction associated with the commitpublic RollbackCommand buildRollbackCommand(GlobalTransaction gtx)
CommandsFactory
buildRollbackCommand
in interface CommandsFactory
gtx
- global transaction associated with the rollbackpublic SingleRpcCommand buildSingleRpcCommand(VisitableCommand call)
CommandsFactory
buildSingleRpcCommand
in interface CommandsFactory
call
- VisitableCommand to include in the envelopepublic ClusteredGetCommand buildClusteredGetCommand(Object key, int segment, long flagsBitSet)
CommandsFactory
buildClusteredGetCommand
in interface CommandsFactory
key
- key to look upsegment
- the segment for the keyflagsBitSet
- Command flags provided by cachepublic 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<?> keys, long flagsBitSet, GlobalTransaction gtx)
CommandsFactory
buildLockControlCommand
in interface CommandsFactory
keys
- keys to lockflagsBitSet
- Command flags provided by cachepublic LockControlCommand buildLockControlCommand(Object key, long flagsBitSet, GlobalTransaction gtx)
CommandsFactory
CommandsFactory.buildLockControlCommand(Object, long, GlobalTransaction)
but for locking a single key vs a collection of keys.buildLockControlCommand
in interface CommandsFactory
public LockControlCommand buildLockControlCommand(Collection<?> keys, long flagsBitSet)
buildLockControlCommand
in interface CommandsFactory
public ConflictResolutionStartCommand buildConflictResolutionStartCommand(int topologyId, IntSet segments)
buildConflictResolutionStartCommand
in interface CommandsFactory
public ScatteredStateConfirmRevokedCommand buildScatteredStateConfirmRevokeCommand(int topologyId, IntSet segments)
buildScatteredStateConfirmRevokeCommand
in interface CommandsFactory
public ScatteredStateGetKeysCommand buildScatteredStateGetKeysCommand(int topologyId, IntSet segments)
buildScatteredStateGetKeysCommand
in interface CommandsFactory
public StateTransferCancelCommand buildStateTransferCancelCommand(int topologyId, IntSet segments)
buildStateTransferCancelCommand
in interface CommandsFactory
public StateTransferGetListenersCommand buildStateTransferGetListenersCommand(int topologyId)
buildStateTransferGetListenersCommand
in interface CommandsFactory
public StateTransferGetTransactionsCommand buildStateTransferGetTransactionsCommand(int topologyId, IntSet segments)
buildStateTransferGetTransactionsCommand
in interface CommandsFactory
public StateTransferStartCommand buildStateTransferStartCommand(int topologyId, IntSet segments)
buildStateTransferStartCommand
in interface CommandsFactory
public StateResponseCommand buildStateResponseCommand(int topologyId, Collection<StateChunk> stateChunks, boolean applyState, boolean pushTransfer)
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(XidImpl 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 GetInDoubtTxInfoCommand buildGetInDoubtTxInfoCommand()
buildGetInDoubtTxInfoCommand
in interface CommandsFactory
GetInDoubtTxInfoCommand
public CompleteTransactionCommand buildCompleteTransactionCommand(XidImpl 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 XSiteStateTransferCancelSendCommand buildXSiteStateTransferCancelSendCommand(String siteName)
buildXSiteStateTransferCancelSendCommand
in interface CommandsFactory
public XSiteStateTransferClearStatusCommand buildXSiteStateTransferClearStatusCommand()
buildXSiteStateTransferClearStatusCommand
in interface CommandsFactory
public XSiteStateTransferFinishReceiveCommand buildXSiteStateTransferFinishReceiveCommand(String siteName)
buildXSiteStateTransferFinishReceiveCommand
in interface CommandsFactory
public XSiteStateTransferFinishSendCommand buildXSiteStateTransferFinishSendCommand(String siteName, boolean statusOk)
buildXSiteStateTransferFinishSendCommand
in interface CommandsFactory
public XSiteStateTransferRestartSendingCommand buildXSiteStateTransferRestartSendingCommand(String siteName, int topologyId)
buildXSiteStateTransferRestartSendingCommand
in interface CommandsFactory
public XSiteStateTransferStartReceiveCommand buildXSiteStateTransferStartReceiveCommand(String siteName)
buildXSiteStateTransferStartReceiveCommand
in interface CommandsFactory
public XSiteStateTransferStartSendCommand buildXSiteStateTransferStartSendCommand(String siteName, int topologyId)
buildXSiteStateTransferStartSendCommand
in interface CommandsFactory
public XSiteStateTransferStatusRequestCommand buildXSiteStateTransferStatusRequestCommand()
buildXSiteStateTransferStatusRequestCommand
in interface CommandsFactory
public XSiteAmendOfflineStatusCommand buildXSiteAmendOfflineStatusCommand(String siteName, Integer afterFailures, Long minTimeToWait)
buildXSiteAmendOfflineStatusCommand
in interface CommandsFactory
public XSiteBringOnlineCommand buildXSiteBringOnlineCommand(String siteName)
buildXSiteBringOnlineCommand
in interface CommandsFactory
public XSiteOfflineStatusCommand buildXSiteOfflineStatusCommand(String siteName)
buildXSiteOfflineStatusCommand
in interface CommandsFactory
public XSiteStatusCommand buildXSiteStatusCommand()
buildXSiteStatusCommand
in interface CommandsFactory
public XSiteTakeOfflineCommand buildXSiteTakeOfflineCommand(String siteName)
buildXSiteTakeOfflineCommand
in interface CommandsFactory
public XSiteStatePushCommand buildXSiteStatePushCommand(XSiteState[] chunk, long timeoutMillis)
CommandsFactory
buildXSiteStatePushCommand
in interface CommandsFactory
chunk
- the data chunktimeoutMillis
- timeout in milliseconds, for the retries in the receiver site.public SingleXSiteRpcCommand buildSingleXSiteRpcCommand(VisitableCommand command)
CommandsFactory
VisitableCommand
on the backup site,buildSingleXSiteRpcCommand
in interface CommandsFactory
command
- the visitable command.public GetKeysInGroupCommand buildGetKeysInGroupCommand(long flagsBitSet, Object groupName)
CommandsFactory
GetKeysInGroupCommand
used to fetch all the keys belonging to a group.buildGetKeysInGroupCommand
in interface CommandsFactory
flagsBitSet
- Command flags provided by cachegroupName
- the group name.public GetCacheEntryCommand buildGetCacheEntryCommand(Object key, int segment, long flagsBitSet)
CommandsFactory
buildGetCacheEntryCommand
in interface CommandsFactory
key
- key to getsegment
- the segment for the keyflagsBitSet
- Command flags provided by cachepublic ClusteredGetAllCommand buildClusteredGetAllCommand(List<?> keys, long flagsBitSet, GlobalTransaction gtx)
CommandsFactory
buildClusteredGetAllCommand
in interface CommandsFactory
keys
- key to look upflagsBitSet
- Command flags provided by cachepublic <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)
buildReadOnlyKeyCommand
in interface CommandsFactory
public <K,V,R> ReadOnlyManyCommand<K,V,R> buildReadOnlyManyCommand(Collection<?> keys, Function<EntryView.ReadEntryView<K,V>,R> f, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
buildReadOnlyManyCommand
in interface CommandsFactory
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, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
buildReadWriteKeyValueCommand
in interface CommandsFactory
public <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)
buildReadWriteKeyCommand
in interface CommandsFactory
public <K,V,R> ReadWriteManyCommand<K,V,R> buildReadWriteManyCommand(Collection<?> keys, Function<EntryView.ReadWriteEntryView<K,V>,R> f, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
buildReadWriteManyCommand
in interface CommandsFactory
public <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)
buildReadWriteManyEntriesCommand
in interface CommandsFactory
public InvalidateVersionsCommand buildInvalidateVersionsCommand(int topologyId, Object[] keys, int[] topologyIds, long[] versions, boolean removed)
buildInvalidateVersionsCommand
in interface CommandsFactory
public <K,V> WriteOnlyKeyCommand<K,V> buildWriteOnlyKeyCommand(Object key, Consumer<EntryView.WriteEntryView<K,V>> f, int segment, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
buildWriteOnlyKeyCommand
in interface CommandsFactory
public <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)
buildWriteOnlyKeyValueCommand
in interface CommandsFactory
public <K,V> WriteOnlyManyCommand<K,V> buildWriteOnlyManyCommand(Collection<?> keys, Consumer<EntryView.WriteEntryView<K,V>> f, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
buildWriteOnlyManyCommand
in interface CommandsFactory
public <K,V,T> WriteOnlyManyEntriesCommand<K,V,T> buildWriteOnlyManyEntriesCommand(Map<?,?> arguments, BiConsumer<T,EntryView.WriteEntryView<K,V>> f, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
buildWriteOnlyManyEntriesCommand
in interface CommandsFactory
public <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)
buildTxReadOnlyKeyCommand
in interface CommandsFactory
public <K,V,R> TxReadOnlyManyCommand<K,V,R> buildTxReadOnlyManyCommand(Collection<?> keys, List<List<Mutation<K,V,?>>> mutations, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
buildTxReadOnlyManyCommand
in interface CommandsFactory
public BackupAckCommand buildBackupAckCommand(long id, int topologyId)
buildBackupAckCommand
in interface CommandsFactory
public BackupMultiKeyAckCommand buildBackupMultiKeyAckCommand(long id, int segment, int topologyId)
buildBackupMultiKeyAckCommand
in interface CommandsFactory
public ExceptionAckCommand buildExceptionAckCommand(long id, Throwable throwable, int topologyId)
buildExceptionAckCommand
in interface CommandsFactory
public RevokeBiasCommand buildRevokeBiasCommand(Address ackTarget, long id, int topologyId, Collection<Object> keys)
buildRevokeBiasCommand
in interface CommandsFactory
public RenewBiasCommand buildRenewBiasCommand(Object[] keys)
buildRenewBiasCommand
in interface CommandsFactory
public SingleKeyBackupWriteCommand buildSingleKeyBackupWriteCommand()
buildSingleKeyBackupWriteCommand
in interface CommandsFactory
public SingleKeyFunctionalBackupWriteCommand buildSingleKeyFunctionalBackupWriteCommand()
buildSingleKeyFunctionalBackupWriteCommand
in interface CommandsFactory
public PutMapBackupWriteCommand buildPutMapBackupWriteCommand()
buildPutMapBackupWriteCommand
in interface CommandsFactory
public MultiEntriesFunctionalBackupWriteCommand buildMultiEntriesFunctionalBackupWriteCommand()
buildMultiEntriesFunctionalBackupWriteCommand
in interface CommandsFactory
public MultiKeyFunctionalBackupWriteCommand buildMultiKeyFunctionalBackupWriteCommand()
buildMultiKeyFunctionalBackupWriteCommand
in interface CommandsFactory
public <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)
buildKeyReductionPublisherCommand
in interface CommandsFactory
public <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)
buildEntryReductionPublisherCommand
in interface CommandsFactory
public <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)
buildInitialPublisherCommand
in interface CommandsFactory
public NextPublisherCommand buildNextPublisherCommand(String requestId)
buildNextPublisherCommand
in interface CommandsFactory
public CancelPublisherCommand buildCancelPublisherCommand(String requestId)
buildCancelPublisherCommand
in interface CommandsFactory
public <K,V> MultiClusterEventCommand<K,V> buildMultiClusterEventCommand(Map<UUID,Collection<ClusterEvent<K,V>>> events)
buildMultiClusterEventCommand
in interface CommandsFactory
public CheckTransactionRpcCommand buildCheckTransactionRpcCommand(Collection<GlobalTransaction> globalTransactions)
buildCheckTransactionRpcCommand
in interface CommandsFactory
public TouchCommand buildTouchCommand(Object key, int segment)
buildTouchCommand
in interface CommandsFactory
public <K,V> IracPutKeyCommand buildIracPutKeyCommand(InternalCacheEntry<K,V> entry)
buildIracPutKeyCommand
in interface CommandsFactory
public IracRemoveKeyCommand buildIracRemoveKeyCommand(Object key, IracMetadata iracMetadata)
buildIracRemoveKeyCommand
in interface CommandsFactory
public IracClearKeysCommand buildIracClearKeysCommand()
buildIracClearKeysCommand
in interface CommandsFactory
public IracCleanupKeyCommand buildIracCleanupKeyCommand(Object key, Object lockOwner, IracMetadata tombstone)
buildIracCleanupKeyCommand
in interface CommandsFactory
public IracMetadataRequestCommand buildIracMetadataRequestCommand(int segment)
buildIracMetadataRequestCommand
in interface CommandsFactory
public IracRequestStateCommand buildIracRequestStateCommand(IntSet segments)
buildIracRequestStateCommand
in interface CommandsFactory
public IracStateResponseCommand buildIracStateResponseCommand(Object key, Object lockOwner, IracMetadata tombstone)
buildIracStateResponseCommand
in interface CommandsFactory
Copyright © 2021 JBoss by Red Hat. All rights reserved.