Package org.infinispan.statetransfer
Class StateProviderImpl
- java.lang.Object
-
- org.infinispan.statetransfer.StateProviderImpl
-
- All Implemented Interfaces:
StateProvider
- Direct Known Subclasses:
ScatteredStateProviderImpl
public class StateProviderImpl extends Object implements StateProvider
StateProviderimplementation.- Since:
- 5.2
- Author:
- anistor@redhat.com
-
-
Field Summary
Fields Modifier and Type Field Description protected StringcacheNameprotected intchunkSizeprotected CommandsFactorycommandsFactoryprotected InternalDataContainer<Object,Object>dataContainerprotected DistributionManagerdistributionManagerprotected InternalEntryFactoryentryFactoryprotected KeyPartitionerkeyPartitionerprotected PersistenceManagerpersistenceManagerprotected RpcManagerrpcManagerprotected StateTransferLockstateTransferLockprotected longtimeoutprotected TransactionOriginatorCheckertransactionOriginatorChecker
-
Constructor Summary
Constructors Constructor Description StateProviderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddTransfer(OutboundTransferTask transferTask)voidcancelOutboundTransfer(Address destination, int topologyId, org.infinispan.commons.util.IntSet segments)Cancel sending of cache entries that belong to the given set of segments.Collection<ClusterListenerReplicateCallable<Object,Object>>getClusterListenersToInstall()CompletionStage<List<TransactionInfo>>getTransactionsForSegments(Address destination, int requestTopologyId, org.infinispan.commons.util.IntSet segments)Gets the list of transactions that affect keys from the given segments.booleanisStateTransferInProgress()protected voidlogError(OutboundTransferTask task, Throwable t)protected voidonTaskCompletion(OutboundTransferTask transferTask)CompletableFuture<Void>onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)Receive notification of topology changes.protected io.reactivex.rxjava3.core.Flowable<InternalCacheEntry<Object,Object>>publishDataContainerEntries(org.infinispan.commons.util.IntSet segments)protected io.reactivex.rxjava3.core.Flowable<InternalCacheEntry<Object,Object>>publishStoreEntries(org.infinispan.commons.util.IntSet segments)voidstart()voidstartOutboundTransfer(Address destination, int requestTopologyId, org.infinispan.commons.util.IntSet segments, boolean applyState)Start to send cache entries that belong to the given set of segments.voidstop()Cancels all outbound state transfers.
-
-
-
Field Detail
-
cacheName
protected String cacheName
-
rpcManager
protected RpcManager rpcManager
-
commandsFactory
protected CommandsFactory commandsFactory
-
dataContainer
protected InternalDataContainer<Object,Object> dataContainer
-
persistenceManager
protected PersistenceManager persistenceManager
-
stateTransferLock
protected StateTransferLock stateTransferLock
-
entryFactory
protected InternalEntryFactory entryFactory
-
keyPartitioner
protected KeyPartitioner keyPartitioner
-
distributionManager
protected DistributionManager distributionManager
-
transactionOriginatorChecker
protected TransactionOriginatorChecker transactionOriginatorChecker
-
timeout
protected long timeout
-
chunkSize
protected int chunkSize
-
-
Method Detail
-
isStateTransferInProgress
public boolean isStateTransferInProgress()
- Specified by:
isStateTransferInProgressin interfaceStateProvider
-
onTopologyUpdate
public CompletableFuture<Void> onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
Description copied from interface:StateProviderReceive notification of topology changes. Cancels all outbound transfers to destinations that are no longer members. The other outbound transfers remain unaffected.- Specified by:
onTopologyUpdatein interfaceStateProvider
-
start
public void start()
- Specified by:
startin interfaceStateProvider
-
stop
public void stop()
Description copied from interface:StateProviderCancels all outbound state transfers. This is executed when the cache is shutting down.- Specified by:
stopin interfaceStateProvider
-
getTransactionsForSegments
public CompletionStage<List<TransactionInfo>> getTransactionsForSegments(Address destination, int requestTopologyId, org.infinispan.commons.util.IntSet segments)
Description copied from interface:StateProviderGets the list of transactions that affect keys from the given segments. This is invoked in response to aStateTransferGetTransactionsCommand.- Specified by:
getTransactionsForSegmentsin interfaceStateProvider- Parameters:
destination- the address of the requesterrequestTopologyId- required topology before we can start collecting transactionssegments- only return transactions affecting these segments- Returns:
- a
CompletionStagethat completes with the list transactions and locks for the given segments
-
getClusterListenersToInstall
public Collection<ClusterListenerReplicateCallable<Object,Object>> getClusterListenersToInstall()
- Specified by:
getClusterListenersToInstallin interfaceStateProvider
-
startOutboundTransfer
public void startOutboundTransfer(Address destination, int requestTopologyId, org.infinispan.commons.util.IntSet segments, boolean applyState)
Description copied from interface:StateProviderStart to send cache entries that belong to the given set of segments. This is invoked in response to aStateTransferStartCommand. If the applyState field is set to false, then upon delivery at the destination the cache entries are processed by aStateReceiverand are not applied to the local cache.- Specified by:
startOutboundTransferin interfaceStateProvider- Parameters:
destination- the address of the requester
-
publishDataContainerEntries
protected io.reactivex.rxjava3.core.Flowable<InternalCacheEntry<Object,Object>> publishDataContainerEntries(org.infinispan.commons.util.IntSet segments)
-
publishStoreEntries
protected io.reactivex.rxjava3.core.Flowable<InternalCacheEntry<Object,Object>> publishStoreEntries(org.infinispan.commons.util.IntSet segments)
-
addTransfer
protected void addTransfer(OutboundTransferTask transferTask)
-
cancelOutboundTransfer
public void cancelOutboundTransfer(Address destination, int topologyId, org.infinispan.commons.util.IntSet segments)
Description copied from interface:StateProviderCancel sending of cache entries that belong to the given set of segments. This is invoked in response to aStateTransferCancelCommand.- Specified by:
cancelOutboundTransferin interfaceStateProvider- Parameters:
destination- the address of the requestersegments- the segments that we have to cancel transfer for
-
onTaskCompletion
protected void onTaskCompletion(OutboundTransferTask transferTask)
-
logError
protected void logError(OutboundTransferTask task, Throwable t)
-
-