Package org.infinispan.statetransfer
Class StateTransferManagerImpl
- java.lang.Object
-
- org.infinispan.statetransfer.StateTransferManagerImpl
-
- All Implemented Interfaces:
StateTransferManager
public class StateTransferManagerImpl extends Object implements StateTransferManager
StateTransferManager
implementation.- 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.CacheTopology
getCacheTopology()
int
getFirstTopologyAsMember()
String
getRebalancingStatus()
boolean
isJoinComplete()
boolean
isStateTransferInProgress()
Checks if an inbound state transfer is in progress.boolean
isStateTransferInProgressForKey(Object key)
Checks if an inbound state transfer is in progress for a given key.boolean
ownsData()
static ConsistentHashFactory
pickConsistentHashFactory(GlobalConfiguration globalConfiguration, Configuration configuration)
If no ConsistentHashFactory was explicitly configured we choose a suitable one based on cache mode.void
start()
void
stop()
String
toString()
void
waitForInitialStateTransferToComplete()
-
-
-
Field Detail
-
cacheName
protected String cacheName
-
-
Method Detail
-
start
public void start() throws Exception
- Specified by:
start
in 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:
waitForInitialStateTransferToComplete
in interfaceStateTransferManager
-
stop
public void stop()
- Specified by:
stop
in interfaceStateTransferManager
-
isJoinComplete
public boolean isJoinComplete()
- Specified by:
isJoinComplete
in interfaceStateTransferManager
-
getRebalancingStatus
public String getRebalancingStatus() throws Exception
- Specified by:
getRebalancingStatus
in interfaceStateTransferManager
- Throws:
Exception
-
isStateTransferInProgress
public boolean isStateTransferInProgress()
Description copied from interface:StateTransferManager
Checks if an inbound state transfer is in progress.- Specified by:
isStateTransferInProgress
in interfaceStateTransferManager
-
isStateTransferInProgressForKey
public boolean isStateTransferInProgressForKey(Object key)
Description copied from interface:StateTransferManager
Checks if an inbound state transfer is in progress for a given key.- Specified by:
isStateTransferInProgressForKey
in interfaceStateTransferManager
- Returns:
-
getCacheTopology
public CacheTopology getCacheTopology()
- Specified by:
getCacheTopology
in interfaceStateTransferManager
-
forwardCommandIfNeeded
public Map<Address,Response> forwardCommandIfNeeded(org.infinispan.commands.TopologyAffectedCommand command, Set<Object> affectedKeys, Address origin)
Description copied from interface:StateTransferManager
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.- Specified by:
forwardCommandIfNeeded
in interfaceStateTransferManager
-
ownsData
public boolean ownsData()
- Specified by:
ownsData
in interfaceStateTransferManager
- Returns:
- true if this node has already received the first rebalance start
-
getFirstTopologyAsMember
public int getFirstTopologyAsMember()
- Specified by:
getFirstTopologyAsMember
in 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).
-
-