Package org.infinispan.statetransfer
Interface StateProvider
-
- All Known Subinterfaces:
ScatteredStateProvider
- All Known Implementing Classes:
StateProviderImpl
public interface StateProvider
Handles outbound state transfers.- Since:
- 5.2
- Author:
- anistor@redhat.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancelOutboundTransfer(Address destination, int topologyId, IntSet segments)
Cancel sending of cache entries that belong to the given set of segments.Collection<DistributedCallable>
getClusterListenersToInstall()
List<TransactionInfo>
getTransactionsForSegments(Address destination, int topologyId, IntSet segments)
Gets the list of transactions that affect keys from the given segments.boolean
isStateTransferInProgress()
CompletableFuture<Void>
onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
Receive notification of topology changes.void
start()
void
startOutboundTransfer(Address destination, int topologyId, IntSet segments, boolean applyState)
Start to send cache entries that belong to the given set of segments.void
stop()
Cancels all outbound state transfers.
-
-
-
Method Detail
-
isStateTransferInProgress
boolean isStateTransferInProgress()
-
onTopologyUpdate
CompletableFuture<Void> onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
Receive notification of topology changes. Cancels all outbound transfers to destinations that are no longer members. The other outbound transfers remain unaffected.- Parameters:
cacheTopology
-isRebalance
-
-
getTransactionsForSegments
List<TransactionInfo> getTransactionsForSegments(Address destination, int topologyId, IntSet segments) throws InterruptedException
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.- Parameters:
destination
- the address of the requestertopologyId
-segments
-- Returns:
- list transactions and locks for the given segments
- Throws:
InterruptedException
-
getClusterListenersToInstall
Collection<DistributedCallable> getClusterListenersToInstall()
-
startOutboundTransfer
void startOutboundTransfer(Address destination, int topologyId, IntSet segments, boolean applyState) throws InterruptedException
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.- Parameters:
destination
- the address of the requestertopologyId
-segments
-applyState
-- Throws:
InterruptedException
-
cancelOutboundTransfer
void cancelOutboundTransfer(Address destination, int topologyId, IntSet segments)
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.- Parameters:
destination
- the address of the requestertopologyId
-segments
- the segments that we have to cancel transfer for
-
start
void start()
-
stop
void stop()
Cancels all outbound state transfers. This is executed when the cache is shutting down.
-
-