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 class
ScatteredStateConsumerImpl.KeyAndVersion
-
Nested classes/interfaces inherited from class org.infinispan.statetransfer.StateConsumerImpl
StateConsumerImpl.KeyInvalidationListener
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecutorService
asyncExecutor
protected Collection<Address>
backupAddress
protected BlockingQueue<InternalCacheEntry>
backupQueue
protected AtomicLong
chunkCounter
protected InternalEntryFactory
entryFactory
protected org.infinispan.commons.util.IntSet
inboundSegments
protected ConcurrentMap<Address,BlockingQueue<ScatteredStateConsumerImpl.KeyAndVersion>>
invalidations
protected Collection<Address>
nonBackupAddresses
protected ConcurrentMap<Address,BlockingQueue<Object>>
retrievedEntries
protected static long
SKIP_OWNERSHIP_FLAGS
protected ScatteredVersionManager
svm
-
Fields inherited from class org.infinispan.statetransfer.StateConsumerImpl
cache, cacheName, cacheNotifier, cacheTopology, commandAckCollector, commandsFactory, commitManager, configuration, dataContainer, distributionManager, icf, interceptorChain, isFetchEnabled, isInvalidationMode, isTotalOrder, isTransactional, keyInvalidationListener, keyPartitioner, localTopologyManager, NO_STATE_TRANSFER_IN_PROGRESS, persistenceManager, remoteCommandsExecutor, rpcManager, rpcOptions, STATE_TRANSFER_FLAGS, stateRequestExecutor, stateTransferExecutor, stateTransferFuture, stateTransferLock, stateTransferTopologyId, timeout, totalOrderManager, 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 void
beforeTopologyInstalled(int topologyId, boolean startRebalance, ConsistentHash previousWriteCh, ConsistentHash newWriteCh)
protected void
handleSegments(boolean startRebalance, org.infinispan.commons.util.IntSet addedSegments, org.infinispan.commons.util.IntSet removedSegments)
protected void
onTaskCompletion(InboundTransferTask inboundTransfer)
CompletableFuture<Void>
onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
Receive notification of topology changes.protected void
removeStaleData(org.infinispan.commons.util.IntSet removedSegments)
void
start()
void
stopApplyingState(int topologyId)
Stops applying incoming state.-
Methods inherited from class org.infinispan.statetransfer.StateConsumerImpl
addTransfer, applyState, cancelTransfers, getCacheTopology, 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
-
asyncExecutor
protected ExecutorService asyncExecutor
-
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:
start
in classStateConsumerImpl
-
onTopologyUpdate
public CompletableFuture<Void> onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
Description copied from interface:StateConsumer
Receive notification of topology changes. StateRequestCommands are issued for segments that are new to this member and the segments that are no longer owned are discarded.- Specified by:
onTopologyUpdate
in interfaceStateConsumer
- Overrides:
onTopologyUpdate
in classStateConsumerImpl
- Returns:
- future that is completed when the state transfer has finished
-
beforeTopologyInstalled
protected void beforeTopologyInstalled(int topologyId, boolean startRebalance, ConsistentHash previousWriteCh, ConsistentHash newWriteCh)
- Overrides:
beforeTopologyInstalled
in classStateConsumerImpl
-
handleSegments
protected void handleSegments(boolean startRebalance, org.infinispan.commons.util.IntSet addedSegments, org.infinispan.commons.util.IntSet removedSegments)
- Overrides:
handleSegments
in classStateConsumerImpl
-
onTaskCompletion
protected void onTaskCompletion(InboundTransferTask inboundTransfer)
- Overrides:
onTaskCompletion
in classStateConsumerImpl
-
stopApplyingState
public void stopApplyingState(int topologyId)
Description copied from class:StateConsumerImpl
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.- Specified by:
stopApplyingState
in interfaceStateConsumer
- Overrides:
stopApplyingState
in classStateConsumerImpl
-
removeStaleData
protected void removeStaleData(org.infinispan.commons.util.IntSet removedSegments) throws InterruptedException
- Overrides:
removeStaleData
in classStateConsumerImpl
- Throws:
InterruptedException
-
-