Package org.infinispan.statetransfer
Interface StateConsumer
- All Known Implementing Classes:
StateConsumerImpl
public interface StateConsumer
Handles inbound state transfers.
- Since:
- 5.2
- Author:
- anistor@redhat.com
-
Method Summary
Modifier and TypeMethodDescriptionapplyState(Address sender, int topologyId, Collection<StateChunk> stateChunks) longReturns the number of in-flight requested segments.longReturns the number of in-flight transactional requested segments.booleanbooleanonTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance) Receive notification of topology changes.booleanownsData()voidstop()Cancels all incoming state transfers.voidstopApplyingState(int topologyId) Stops applying incoming state.
-
Method Details
-
isStateTransferInProgress
boolean isStateTransferInProgress() -
isStateTransferInProgressForKey
-
inflightRequestCount
long inflightRequestCount()Returns the number of in-flight requested segments. -
inflightTransactionSegmentCount
long inflightTransactionSegmentCount()Returns the number of in-flight transactional requested segments. -
onTopologyUpdate
CompletionStage<CompletionStage<Void>> onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance) Receive notification of topology changes.StateTransferStartCommand, are issued for segments that are new to this member and the segments that are no longer owned are discarded.- Returns:
- completion stage that is completed when the topology update is processed, wrapping another completion stage that is completed when the state transfer has finished
-
applyState
-
stop
void stop()Cancels all incoming state transfers. The already received data is not discarded. This is executed when the cache is shutting down. -
stopApplyingState
void stopApplyingState(int topologyId) Stops applying incoming state. Also stops tracking updated keys. Should be called at the end of state transfer or when a ClearCommand is committed during state transfer.- Parameters:
topologyId- Topology id at the end of state transfer
-
ownsData
boolean ownsData()- Returns:
- true if this node has already received the first rebalance command
-