public interface StateConsumer
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 |
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 |
stop()
Cancels all incoming state transfers.
|
void |
stopApplyingState()
Stops applying incoming state.
|
CacheTopology getCacheTopology()
boolean isStateTransferInProgress()
boolean isStateTransferInProgressForKey(Object key)
void onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
cacheTopology
- isRebalance
- void applyState(Address sender, int topologyId, Collection<StateChunk> stateChunks)
void stop()
void addUpdatedKey(Object key)
key
- the key that is being modifiedboolean isKeyUpdated(Object key)
key
- the key to checkboolean executeIfKeyIsNotUpdated(Object key, Runnable callback)
key
- The key to checkcallback
- The callback to runtrue
if the callback was executed, false
otherwise.void stopApplyingState()
boolean ownsData()
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.