Package org.infinispan.statetransfer
Class StateProviderImpl
- java.lang.Object
-
- org.infinispan.statetransfer.StateProviderImpl
-
- All Implemented Interfaces:
StateProvider
public class StateProviderImpl extends java.lang.Object implements StateProvider
StateProvider
implementation.- Since:
- 5.2
- Author:
- anistor@redhat.com
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
cacheName
protected int
chunkSize
protected org.infinispan.commands.CommandsFactory
commandsFactory
protected org.infinispan.container.impl.InternalDataContainer<java.lang.Object,java.lang.Object>
dataContainer
protected DistributionManager
distributionManager
protected org.infinispan.container.impl.InternalEntryFactory
entryFactory
protected KeyPartitioner
keyPartitioner
protected PersistenceManager
persistenceManager
protected RpcManager
rpcManager
protected StateTransferLock
stateTransferLock
protected long
timeout
protected org.infinispan.transaction.impl.TransactionOriginatorChecker
transactionOriginatorChecker
-
Constructor Summary
Constructors Constructor Description StateProviderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addTransfer(OutboundTransferTask transferTask)
void
cancelOutboundTransfer(Address destination, int topologyId, IntSet segments)
Cancel sending of cache entries that belong to the given set of segments.java.util.Collection<ClusterListenerReplicateCallable<java.lang.Object,java.lang.Object>>
getClusterListenersToInstall()
java.util.concurrent.CompletionStage<java.util.List<TransactionInfo>>
getTransactionsForSegments(Address destination, int requestTopologyId, IntSet segments)
Gets the list of transactions that affect keys from the given segments.boolean
isStateTransferInProgress()
protected void
logError(OutboundTransferTask task, java.lang.Throwable t)
protected void
onTaskCompletion(OutboundTransferTask transferTask)
java.util.concurrent.CompletableFuture<java.lang.Void>
onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
Receive notification of topology changes.protected io.reactivex.Flowable<InternalCacheEntry<java.lang.Object,java.lang.Object>>
publishDataContainerEntries(IntSet segments)
protected io.reactivex.Flowable<InternalCacheEntry<java.lang.Object,java.lang.Object>>
publishStoreEntries(IntSet segments)
void
start()
void
startOutboundTransfer(Address destination, int requestTopologyId, IntSet segments, boolean applyState)
Start to send cache entries that belong to the given set of segments.void
stop()
Cancels all outbound state transfers.
-
-
-
Field Detail
-
cacheName
protected java.lang.String cacheName
-
rpcManager
protected RpcManager rpcManager
-
commandsFactory
protected org.infinispan.commands.CommandsFactory commandsFactory
-
dataContainer
protected org.infinispan.container.impl.InternalDataContainer<java.lang.Object,java.lang.Object> dataContainer
-
persistenceManager
protected PersistenceManager persistenceManager
-
stateTransferLock
protected StateTransferLock stateTransferLock
-
entryFactory
protected org.infinispan.container.impl.InternalEntryFactory entryFactory
-
keyPartitioner
protected KeyPartitioner keyPartitioner
-
distributionManager
protected DistributionManager distributionManager
-
transactionOriginatorChecker
protected org.infinispan.transaction.impl.TransactionOriginatorChecker transactionOriginatorChecker
-
timeout
protected long timeout
-
chunkSize
protected int chunkSize
-
-
Method Detail
-
isStateTransferInProgress
public boolean isStateTransferInProgress()
- Specified by:
isStateTransferInProgress
in interfaceStateProvider
-
onTopologyUpdate
public java.util.concurrent.CompletableFuture<java.lang.Void> onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
Description copied from interface:StateProvider
Receive notification of topology changes. Cancels all outbound transfers to destinations that are no longer members. The other outbound transfers remain unaffected.- Specified by:
onTopologyUpdate
in interfaceStateProvider
-
start
public void start()
- Specified by:
start
in interfaceStateProvider
-
stop
public void stop()
Description copied from interface:StateProvider
Cancels all outbound state transfers. This is executed when the cache is shutting down.- Specified by:
stop
in interfaceStateProvider
-
getTransactionsForSegments
public java.util.concurrent.CompletionStage<java.util.List<TransactionInfo>> getTransactionsForSegments(Address destination, int requestTopologyId, IntSet segments)
Description copied from interface:StateProvider
Gets the list of transactions that affect keys from the given segments. This is invoked in response to a StateRequestCommand of type StateRequestCommand.Type.GET_TRANSACTIONS.- Specified by:
getTransactionsForSegments
in interfaceStateProvider
- Parameters:
destination
- the address of the requesterrequestTopologyId
- required topology before we can start collecting transactionssegments
- only return transactions affecting these segments- Returns:
- a
CompletionStage
that completes with the list transactions and locks for the given segments
-
getClusterListenersToInstall
public java.util.Collection<ClusterListenerReplicateCallable<java.lang.Object,java.lang.Object>> getClusterListenersToInstall()
- Specified by:
getClusterListenersToInstall
in interfaceStateProvider
-
startOutboundTransfer
public void startOutboundTransfer(Address destination, int requestTopologyId, IntSet segments, boolean applyState)
Description copied from interface:StateProvider
Start to send cache entries that belong to the given set of segments. This is invoked in response to a StateRequestCommand of type StateRequestCommand.Type.START_STATE_TRANSFER. If the applyState field is set to false, then upon delivery at the destination the cache entries are processed by aStateReceiver
and are not applied to the local cache.- Specified by:
startOutboundTransfer
in interfaceStateProvider
- Parameters:
destination
- the address of the requester
-
publishDataContainerEntries
protected io.reactivex.Flowable<InternalCacheEntry<java.lang.Object,java.lang.Object>> publishDataContainerEntries(IntSet segments)
-
publishStoreEntries
protected io.reactivex.Flowable<InternalCacheEntry<java.lang.Object,java.lang.Object>> publishStoreEntries(IntSet segments)
-
addTransfer
protected void addTransfer(OutboundTransferTask transferTask)
-
cancelOutboundTransfer
public void cancelOutboundTransfer(Address destination, int topologyId, IntSet segments)
Description copied from interface:StateProvider
Cancel sending of cache entries that belong to the given set of segments. This is invoked in response to a StateRequestCommand of type StateRequestCommand.Type.CANCEL_STATE_TRANSFER.- Specified by:
cancelOutboundTransfer
in 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, java.lang.Throwable t)
-
-