Package org.infinispan.scattered.impl
Class ScatteredStateConsumerImpl
- java.lang.Object
-
- org.infinispan.statetransfer.StateConsumerImpl
-
- org.infinispan.scattered.impl.ScatteredStateConsumerImpl
-
- All Implemented Interfaces:
StateConsumer
public class ScatteredStateConsumerImpl extends StateConsumerImpl
- Author:
- Radim Vansa <rvansa@redhat.com>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classScatteredStateConsumerImpl.KeyAndVersion-
Nested classes/interfaces inherited from class org.infinispan.statetransfer.StateConsumerImpl
StateConsumerImpl.KeyInvalidationListener
-
-
Field Summary
Fields Modifier and Type Field Description protected Collection<Address>backupAddressprotected BlockingQueue<InternalCacheEntry<?,?>>backupQueueprotected AtomicLongchunkCounterprotected InternalEntryFactoryentryFactoryprotected org.infinispan.commons.util.IntSetinboundSegmentsprotected ConcurrentMap<Address,BlockingQueue<ScatteredStateConsumerImpl.KeyAndVersion>>invalidationsprotected Collection<Address>nonBackupAddressesprotected ConcurrentMap<Address,BlockingQueue<Object>>retrievedEntriesprotected static longSKIP_OWNERSHIP_FLAGSprotected ScatteredVersionManager<?>svm-
Fields inherited from class org.infinispan.statetransfer.StateConsumerImpl
cache, cacheName, cacheNotifier, cacheTopology, commandAckCollector, commandsFactory, commitManager, configuration, dataContainer, distributionManager, icf, interceptorChain, isFetchEnabled, isInvalidationMode, isTransactional, keyInvalidationListener, keyPartitioner, localTopologyManager, NO_KEY, NO_STATE_TRANSFER_IN_PROGRESS, nonBlockingExecutor, persistenceManager, rpcManager, rpcOptions, STATE_TRANSFER_FLAGS, stateRequestExecutor, stateTransferFuture, stateTransferLock, stateTransferTopologyId, timeout, transactionManager, transactionTable, transferMapsLock, transfersBySegment, triangleOrderManager, waitingForState
-
-
Constructor Summary
Constructors Constructor Description ScatteredStateConsumerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbeforeTopologyInstalled(int topologyId, boolean startRebalance, ConsistentHash previousWriteCh, ConsistentHash newWriteCh)protected CompletionStage<Void>handleSegments(boolean startRebalance, org.infinispan.commons.util.IntSet addedSegments, org.infinispan.commons.util.IntSet removedSegments)protected voidonTaskCompletion(InboundTransferTask inboundTransfer)CompletionStage<CompletionStage<Void>>onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)Receive notification of topology changes.protected CompletionStage<Void>removeStaleData(org.infinispan.commons.util.IntSet removedSegments)voidstart()voidstopApplyingState(int topologyId)Stops applying incoming state.-
Methods inherited from class org.infinispan.statetransfer.StateConsumerImpl
addTransfer, applyState, cancelTransfers, getOwnedSegments, hasActiveTransfers, isStateTransferInProgress, isStateTransferInProgressForKey, notifyEndOfStateTransferIfNeeded, ownsData, removeTransfer, setKeyInvalidationListener, stop
-
-
-
-
Field Detail
-
SKIP_OWNERSHIP_FLAGS
protected static final long SKIP_OWNERSHIP_FLAGS
-
entryFactory
protected InternalEntryFactory entryFactory
-
svm
protected ScatteredVersionManager<?> svm
-
inboundSegments
protected org.infinispan.commons.util.IntSet inboundSegments
-
chunkCounter
protected AtomicLong chunkCounter
-
retrievedEntries
protected final ConcurrentMap<Address,BlockingQueue<Object>> retrievedEntries
-
backupQueue
protected BlockingQueue<InternalCacheEntry<?,?>> backupQueue
-
invalidations
protected final ConcurrentMap<Address,BlockingQueue<ScatteredStateConsumerImpl.KeyAndVersion>> invalidations
-
backupAddress
protected Collection<Address> backupAddress
-
nonBackupAddresses
protected Collection<Address> nonBackupAddresses
-
-
Method Detail
-
start
public void start()
- Overrides:
startin classStateConsumerImpl
-
onTopologyUpdate
public CompletionStage<CompletionStage<Void>> onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
Description copied from interface:StateConsumerReceive notification of topology changes.StateTransferStartCommand, orScatteredStateGetKeysCommandforCacheMode.SCATTERED_SYNC, are issued for segments that are new to this member and the segments that are no longer owned are discarded.- Specified by:
onTopologyUpdatein interfaceStateConsumer- Overrides:
onTopologyUpdatein classStateConsumerImpl- 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
-
beforeTopologyInstalled
protected void beforeTopologyInstalled(int topologyId, boolean startRebalance, ConsistentHash previousWriteCh, ConsistentHash newWriteCh)- Overrides:
beforeTopologyInstalledin classStateConsumerImpl
-
handleSegments
protected CompletionStage<Void> handleSegments(boolean startRebalance, org.infinispan.commons.util.IntSet addedSegments, org.infinispan.commons.util.IntSet removedSegments)
- Overrides:
handleSegmentsin classStateConsumerImpl
-
onTaskCompletion
protected void onTaskCompletion(InboundTransferTask inboundTransfer)
- Overrides:
onTaskCompletionin classStateConsumerImpl
-
stopApplyingState
public void stopApplyingState(int topologyId)
Description copied from class:StateConsumerImplStops 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.- Specified by:
stopApplyingStatein interfaceStateConsumer- Overrides:
stopApplyingStatein classStateConsumerImpl- Parameters:
topologyId- Topology id at the end of state transfer
-
removeStaleData
protected CompletionStage<Void> removeStaleData(org.infinispan.commons.util.IntSet removedSegments)
- Overrides:
removeStaleDatain classStateConsumerImpl
-
-