|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CommandsFactory
A factory to build commands, initializing and injecting dependencies accordingly. Commands built for a specific, named cache instance cannot be reused on a different cache instance since most commands contain the cache name it was built for along with references to other named-cache scoped components.
Method Summary | |
---|---|
ClearCommand |
buildClearCommand()
Builds a ClearCommand |
ClusteredGetCommand |
buildClusteredGetCommand(Object key)
Builds a ClusteredGetCommand, which is a remote lookup command |
CommitCommand |
buildCommitCommand(GlobalTransaction gtx)
Builds a CommitCommand |
EntrySetCommand |
buildEntrySetCommand()
Builds a EntrySetCommand |
EvictCommand |
buildEvictCommand(Object key)
Builds an EvictCommand |
GetKeyValueCommand |
buildGetKeyValueCommand(Object key)
Builds a GetKeyValueCommand |
InvalidateCommand |
buildInvalidateCommand(Object... keys)
Builds an InvalidateCommand |
InvalidateCommand |
buildInvalidateFromL1Command(boolean forRehash,
Object... keys)
Builds an InvalidateFromL1Command |
KeySetCommand |
buildKeySetCommand()
Builds a KeySetCommand |
LockControlCommand |
buildLockControlCommand(Collection keys,
boolean implicit)
Builds a LockControlCommand to control explicit remote locking |
PrepareCommand |
buildPrepareCommand(GlobalTransaction gtx,
List<WriteCommand> modifications,
boolean onePhaseCommit)
Builds a PrepareCommand |
PutKeyValueCommand |
buildPutKeyValueCommand(Object key,
Object value,
long lifespanMillis,
long maxIdleTimeMillis)
Builds a PutKeyValueCommand |
PutMapCommand |
buildPutMapCommand(Map map,
long lifespanMillis,
long maxIdleTimeMillis)
Builds a PutMapCommand |
RehashControlCommand |
buildRehashControlCommand(Address sender,
Map<Object,InternalCacheValue> state)
Builds a RehashControlCommand for coordinating a rehash event. |
RehashControlCommand |
buildRehashControlCommand(RehashControlCommand.Type subtype,
Address sender)
Builds a RehashControlCommand for coordinating a rehash event. |
RehashControlCommand |
buildRehashControlCommand(RehashControlCommand.Type subtype,
Address sender,
Map<Object,InternalCacheValue> state,
ConsistentHash consistentHash)
A more generic version of this factory method that allows the setting of various fields. |
RehashControlCommand |
buildRehashControlCommandTxLog(Address sender,
List<WriteCommand> state)
Builds a RehashControlCommand for coordinating a rehash event. |
RehashControlCommand |
buildRehashControlCommandTxLogPendingPrepares(Address sender,
List<PrepareCommand> state)
Builds a RehashControlCommand for coordinating a rehash event. |
RemoveCommand |
buildRemoveCommand(Object key,
Object value)
Builds a RemoveCommand |
ReplaceCommand |
buildReplaceCommand(Object key,
Object oldValue,
Object newValue,
long lifespanMillis,
long maxIdleTimeMillis)
Builds a ReplaceCommand |
MultipleRpcCommand |
buildReplicateCommand(List<ReplicableCommand> toReplicate)
Builds an RpcCommand "envelope" containing multiple ReplicableCommands |
RollbackCommand |
buildRollbackCommand(GlobalTransaction gtx)
Builds a RollbackCommand |
SingleRpcCommand |
buildSingleRpcCommand(ReplicableCommand call)
Builds a SingleRpcCommand "envelope" containing a single ReplicableCommand |
SizeCommand |
buildSizeCommand()
Builds a SizeCommand |
StateTransferControlCommand |
buildStateTransferControlCommand(boolean block)
Builds a StateTransferControlCommand |
ValuesCommand |
buildValuesCommand()
Builds a ValuesCommand |
void |
initializeReplicableCommand(ReplicableCommand command)
Initializes a ReplicableCommand read from a data stream with components specific
to the target cache instance. |
Method Detail |
---|
PutKeyValueCommand buildPutKeyValueCommand(Object key, Object value, long lifespanMillis, long maxIdleTimeMillis)
key
- key to putvalue
- value to putlifespanMillis
- lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis
- max idle time in milliseconds. -1 if maxIdle is not used.
RemoveCommand buildRemoveCommand(Object key, Object value)
key
- key to removevalue
- value to check for ina conditional remove, or null for an unconditional remove.
InvalidateCommand buildInvalidateCommand(Object... keys)
keys
- keys to invalidate
InvalidateCommand buildInvalidateFromL1Command(boolean forRehash, Object... keys)
forRehash
- set to true if the invalidation is happening due to a new node taking ownership. False if it is due to a write, changing the state of the entry.keys
- keys to invalidate
ReplaceCommand buildReplaceCommand(Object key, Object oldValue, Object newValue, long lifespanMillis, long maxIdleTimeMillis)
key
- key to replaceoldValue
- existing value to check for if conditional, null if unconditional.newValue
- value to replace withlifespanMillis
- lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis
- max idle time in milliseconds. -1 if maxIdle is not used.
SizeCommand buildSizeCommand()
GetKeyValueCommand buildGetKeyValueCommand(Object key)
key
- key to get
KeySetCommand buildKeySetCommand()
ValuesCommand buildValuesCommand()
EntrySetCommand buildEntrySetCommand()
PutMapCommand buildPutMapCommand(Map map, long lifespanMillis, long maxIdleTimeMillis)
map
- map containing key/value entries to putlifespanMillis
- lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis
- max idle time in milliseconds. -1 if maxIdle is not used.
ClearCommand buildClearCommand()
EvictCommand buildEvictCommand(Object key)
key
- key to evict
PrepareCommand 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?
CommitCommand buildCommitCommand(GlobalTransaction gtx)
gtx
- global transaction associated with the commit
RollbackCommand buildRollbackCommand(GlobalTransaction gtx)
gtx
- global transaction associated with the rollback
void initializeReplicableCommand(ReplicableCommand command)
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.MultipleRpcCommand buildReplicateCommand(List<ReplicableCommand> toReplicate)
toReplicate
- ReplicableCommands to include in the envelope
SingleRpcCommand buildSingleRpcCommand(ReplicableCommand call)
call
- ReplicableCommand to include in the envelope
StateTransferControlCommand buildStateTransferControlCommand(boolean block)
block
- whether to start blocking or not
ClusteredGetCommand buildClusteredGetCommand(Object key)
key
- key to look up
LockControlCommand buildLockControlCommand(Collection keys, boolean implicit)
keys
- keys to lockimplicit
- whether the lock command was implicit (triggered internally) or explicit (triggered by an API call)
RehashControlCommand buildRehashControlCommand(RehashControlCommand.Type subtype, Address sender)
subtype
- type of RehashControlCommandsender
- sender's Address
RehashControlCommand buildRehashControlCommand(Address sender, Map<Object,InternalCacheValue> state)
RehashControlCommand.Type
of this command is RehashControlCommand.Type.PUSH_STATE
.
sender
- sender's Addressstate
- state map to be pushed to the recipient of this command
RehashControlCommand buildRehashControlCommandTxLog(Address sender, List<WriteCommand> state)
RehashControlCommand.Type
of this command is RehashControlCommand.Type.DRAIN_TX
.
sender
- sender's Addressstate
- list of writes
RehashControlCommand buildRehashControlCommandTxLogPendingPrepares(Address sender, List<PrepareCommand> state)
RehashControlCommand.Type
of this command is RehashControlCommand.Type.DRAIN_TX_PREPARES
.
sender
- sender's Addressstate
- list of pending prepares
RehashControlCommand buildRehashControlCommand(RehashControlCommand.Type subtype, Address sender, Map<Object,InternalCacheValue> state, ConsistentHash consistentHash)
subtype
- type of RehashControlCommandsender
- sender's Addressstate
- state to pushconsistentHash
- consistent hash to deliver
|
Google Analytics | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |