Package org.infinispan.statetransfer
Class StateTransferManagerImpl
- java.lang.Object
-
- org.infinispan.statetransfer.StateTransferManagerImpl
-
- All Implemented Interfaces:
StateTransferManager
public class StateTransferManagerImpl extends Object implements StateTransferManager
StateTransferManagerimplementation.- Since:
- 5.2
- Author:
- anistor@redhat.com
-
-
Constructor Summary
Constructors Constructor Description StateTransferManagerImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Address,Response>forwardCommandIfNeeded(org.infinispan.commands.TopologyAffectedCommand command, Set<Object> affectedKeys, Address origin)If there is an state transfer happening at the moment, this method forwards the supplied command to the nodes that are new owners of the data, in order to assure consistency.CacheTopologygetCacheTopology()intgetFirstTopologyAsMember()StringgetRebalancingStatus()booleanisJoinComplete()booleanisStateTransferInProgress()Checks if an inbound state transfer is in progress.booleanisStateTransferInProgressForKey(Object key)Checks if an inbound state transfer is in progress for a given key.booleanownsData()static ConsistentHashFactorypickConsistentHashFactory(GlobalConfiguration globalConfiguration, Configuration configuration)If no ConsistentHashFactory was explicitly configured we choose a suitable one based on cache mode.voidstart()voidstop()StringtoString()voidwaitForInitialStateTransferToComplete()
-
-
-
Field Detail
-
cacheName
protected String cacheName
-
-
Method Detail
-
start
public void start() throws Exception- Specified by:
startin interfaceStateTransferManager- Throws:
Exception
-
pickConsistentHashFactory
public static ConsistentHashFactory pickConsistentHashFactory(GlobalConfiguration globalConfiguration, Configuration configuration)
If no ConsistentHashFactory was explicitly configured we choose a suitable one based on cache mode.
-
waitForInitialStateTransferToComplete
public void waitForInitialStateTransferToComplete()
- Specified by:
waitForInitialStateTransferToCompletein interfaceStateTransferManager
-
stop
public void stop()
- Specified by:
stopin interfaceStateTransferManager
-
isJoinComplete
public boolean isJoinComplete()
- Specified by:
isJoinCompletein interfaceStateTransferManager
-
getRebalancingStatus
public String getRebalancingStatus() throws Exception
- Specified by:
getRebalancingStatusin interfaceStateTransferManager- Throws:
Exception
-
isStateTransferInProgress
public boolean isStateTransferInProgress()
Description copied from interface:StateTransferManagerChecks if an inbound state transfer is in progress.- Specified by:
isStateTransferInProgressin interfaceStateTransferManager
-
isStateTransferInProgressForKey
public boolean isStateTransferInProgressForKey(Object key)
Description copied from interface:StateTransferManagerChecks if an inbound state transfer is in progress for a given key.- Specified by:
isStateTransferInProgressForKeyin interfaceStateTransferManager- Returns:
-
getCacheTopology
public CacheTopology getCacheTopology()
- Specified by:
getCacheTopologyin interfaceStateTransferManager
-
forwardCommandIfNeeded
public Map<Address,Response> forwardCommandIfNeeded(org.infinispan.commands.TopologyAffectedCommand command, Set<Object> affectedKeys, Address origin)
Description copied from interface:StateTransferManagerIf there is an state transfer happening at the moment, this method forwards the supplied command to the nodes that are new owners of the data, in order to assure consistency.- Specified by:
forwardCommandIfNeededin interfaceStateTransferManager
-
ownsData
public boolean ownsData()
- Specified by:
ownsDatain interfaceStateTransferManager- Returns:
- true if this node has already received the first rebalance start
-
getFirstTopologyAsMember
public int getFirstTopologyAsMember()
- Specified by:
getFirstTopologyAsMemberin interfaceStateTransferManager- Returns:
- The id of the first cache topology in which the local node was a member (even if it didn't own any data).
-
-