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 |
---|---|
protected void |
addTransfer(InboundTransferTask inboundTransfer,
IntSet segments) |
CompletionStage<?> |
applyState(Address sender,
int topologyId,
boolean pushTransfer,
Collection<StateChunk> stateChunks) |
protected void |
beforeTopologyInstalled(int topologyId,
boolean startRebalance,
ConsistentHash previousWriteCh,
ConsistentHash newWriteCh) |
protected void |
cancelTransfers(IntSet removedSegments)
Cancel transfers for segments we no longer own.
|
protected IntSet |
getOwnedSegments(ConsistentHash consistentHash) |
protected CompletionStage<Void> |
handleSegments(boolean startRebalance,
IntSet addedSegments,
IntSet removedSegments) |
boolean |
hasActiveTransfers() |
boolean |
isStateTransferInProgress() |
boolean |
isStateTransferInProgressForKey(Object key) |
protected boolean |
notifyEndOfStateTransferIfNeeded() |
protected void |
onTaskCompletion(InboundTransferTask inboundTransfer) |
CompletionStage<CompletionStage<Void>> |
onTopologyUpdate(CacheTopology cacheTopology,
boolean isRebalance)
Receive notification of topology changes.
|
boolean |
ownsData() |
protected CompletionStage<Void> |
removeStaleData(IntSet removedSegments) |
protected boolean |
removeTransfer(InboundTransferTask inboundTransfer) |
void |
setKeyInvalidationListener(StateConsumerImpl.KeyInvalidationListener keyInvalidationListener) |
void |
start() |
void |
stop()
Cancels all incoming state transfers.
|
void |
stopApplyingState(int topologyId)
Stops applying incoming state.
|
protected static final int NO_STATE_TRANSFER_IN_PROGRESS
protected static final long STATE_TRANSFER_FLAGS
public static final String NO_KEY
protected ComponentRef<Cache<Object,Object>> cache
protected LocalTopologyManager localTopologyManager
protected Configuration configuration
protected RpcManager rpcManager
protected TransactionManager transactionManager
protected CommandsFactory commandsFactory
protected TransactionTable transactionTable
protected InternalDataContainer<Object,Object> dataContainer
protected PersistenceManager persistenceManager
protected AsyncInterceptorChain interceptorChain
protected InvocationContextFactory icf
protected StateTransferLock stateTransferLock
protected CacheNotifier<?,?> cacheNotifier
protected CommitManager commitManager
protected Executor nonBlockingExecutor
protected CommandAckCollector commandAckCollector
protected TriangleOrderManager triangleOrderManager
protected DistributionManager distributionManager
protected KeyPartitioner keyPartitioner
protected String cacheName
protected long timeout
protected boolean isFetchEnabled
protected boolean isTransactional
protected boolean isInvalidationMode
protected volatile StateConsumerImpl.KeyInvalidationListener keyInvalidationListener
protected volatile CacheTopology cacheTopology
protected final AtomicInteger stateTransferTopologyId
protected final AtomicBoolean waitingForState
protected CompletableFuture<Void> stateTransferFuture
protected final Object transferMapsLock
protected final Map<Integer,List<InboundTransferTask>> transfersBySegment
protected LimitedExecutor stateRequestExecutor
protected RpcOptions rpcOptions
public void stopApplyingState(int topologyId)
stopApplyingState
in interface StateConsumer
topologyId
- Topology id at the end of state transferpublic 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 CompletionStage<CompletionStage<Void>> onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
StateConsumer
StateTransferStartCommand
,
or ScatteredStateGetKeysCommand
for
CacheMode.SCATTERED_SYNC
, are issued for segments that are new to this
member and the segments that are no longer owned are discarded.onTopologyUpdate
in interface StateConsumer
protected void beforeTopologyInstalled(int topologyId, boolean startRebalance, ConsistentHash previousWriteCh, ConsistentHash newWriteCh)
protected CompletionStage<Void> handleSegments(boolean startRebalance, IntSet addedSegments, IntSet removedSegments)
protected boolean notifyEndOfStateTransferIfNeeded()
protected IntSet getOwnedSegments(ConsistentHash consistentHash)
public CompletionStage<?> applyState(Address sender, int topologyId, boolean pushTransfer, Collection<StateChunk> stateChunks)
applyState
in interface StateConsumer
public void start()
public void stop()
StateConsumer
stop
in interface StateConsumer
public void setKeyInvalidationListener(StateConsumerImpl.KeyInvalidationListener keyInvalidationListener)
protected void cancelTransfers(IntSet removedSegments)
removedSegments
- segments to be cancelledprotected CompletionStage<Void> removeStaleData(IntSet removedSegments)
protected void addTransfer(InboundTransferTask inboundTransfer, IntSet segments)
protected boolean removeTransfer(InboundTransferTask inboundTransfer)
protected void onTaskCompletion(InboundTransferTask inboundTransfer)
Copyright © 2021 JBoss by Red Hat. All rights reserved.