public class StateConsumerImpl extends Object implements StateConsumer
StateConsumer
implementation.Modifier and Type | Class and Description |
---|---|
static interface |
StateConsumerImpl.KeyInvalidationListener |
Constructor and Description |
---|
StateConsumerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addUpdatedKey(Object key)
Receive notification of updated keys right before they are committed in DataContainer.
|
void |
applyState(Address sender,
int topologyId,
Collection<StateChunk> stateChunks) |
boolean |
executeIfKeyIsNotUpdated(Object key,
Runnable callback)
Run a callback only if the key was not updated by user code, and prevent user code from updating
the key while running the callback.
|
CacheTopology |
getCacheTopology() |
boolean |
hasActiveTransfers() |
void |
init(Cache cache,
ExecutorService executorService,
StateTransferManager stateTransferManager,
InterceptorChain interceptorChain,
InvocationContextFactory icf,
Configuration configuration,
RpcManager rpcManager,
TransactionManager transactionManager,
CommandsFactory commandsFactory,
PersistenceManager persistenceManager,
DataContainer dataContainer,
TransactionTable transactionTable,
StateTransferLock stateTransferLock,
CacheNotifier cacheNotifier,
TotalOrderManager totalOrderManager,
BlockingTaskAwareExecutorService remoteCommandsExecutor,
L1Manager l1Manager) |
boolean |
isKeyUpdated(Object key)
Checks if a given key was updated by user code during state transfer (and consequently it is untouchable by state transfer).
|
boolean |
isStateTransferInProgress() |
boolean |
isStateTransferInProgressForKey(Object key) |
void |
onTopologyUpdate(CacheTopology cacheTopology,
boolean isRebalance)
Receive notification of topology changes.
|
boolean |
ownsData() |
void |
setKeyInvalidationListener(StateConsumerImpl.KeyInvalidationListener keyInvalidationListener) |
void |
start() |
void |
stop()
Cancels all incoming state transfers.
|
void |
stopApplyingState()
Stops applying incoming state.
|
public void stopApplyingState()
stopApplyingState
in interface StateConsumer
public void addUpdatedKey(Object key)
addUpdatedKey
in interface StateConsumer
key
- the key that is being modifiedpublic boolean isKeyUpdated(Object key)
isKeyUpdated
in interface StateConsumer
key
- the key to checkpublic boolean executeIfKeyIsNotUpdated(Object key, Runnable callback)
StateConsumer
executeIfKeyIsNotUpdated
in interface StateConsumer
key
- The key to checkcallback
- The callback to runtrue
if the callback was executed, false
otherwise.public void init(Cache cache, ExecutorService executorService, StateTransferManager stateTransferManager, InterceptorChain interceptorChain, InvocationContextFactory icf, Configuration configuration, RpcManager rpcManager, TransactionManager transactionManager, CommandsFactory commandsFactory, PersistenceManager persistenceManager, DataContainer dataContainer, TransactionTable transactionTable, StateTransferLock stateTransferLock, CacheNotifier cacheNotifier, TotalOrderManager totalOrderManager, BlockingTaskAwareExecutorService remoteCommandsExecutor, L1Manager l1Manager)
public boolean hasActiveTransfers()
public boolean isStateTransferInProgress()
isStateTransferInProgress
in interface StateConsumer
public boolean isStateTransferInProgressForKey(Object key)
isStateTransferInProgressForKey
in interface StateConsumer
public boolean ownsData()
ownsData
in interface StateConsumer
public void onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
StateConsumer
onTopologyUpdate
in interface StateConsumer
public void applyState(Address sender, int topologyId, Collection<StateChunk> stateChunks)
applyState
in interface StateConsumer
public void start()
public void stop()
StateConsumer
stop
in interface StateConsumer
public CacheTopology getCacheTopology()
getCacheTopology
in interface StateConsumer
public void setKeyInvalidationListener(StateConsumerImpl.KeyInvalidationListener keyInvalidationListener)
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.