org.infinispan.topology
Class ClusterCacheStatus
java.lang.Object
org.infinispan.topology.ClusterCacheStatus
public class ClusterCacheStatus
- extends Object
Keeps track of a cache's status: members, current/pending consistent hashes, and rebalance status
- Since:
- 5.2
- Author:
- Dan Berindei
ClusterCacheStatus
public ClusterCacheStatus(String cacheName,
CacheJoinInfo joinInfo)
getJoinInfo
public CacheJoinInfo getJoinInfo()
getMembers
public List<Address> getMembers()
hasMembers
public boolean hasMembers()
getJoiners
public List<Address> getJoiners()
hasJoiners
public boolean hasJoiners()
setMembers
public void setMembers(List<Address> newMembers)
addMember
public boolean addMember(Address joiner)
- Returns:
true
if the joiner was not already a member, false
otherwise
removeMember
public boolean removeMember(Address leaver)
- Returns:
true
if the leaver was a member, false
otherwise
updateClusterMembers
public boolean updateClusterMembers(List<Address> newClusterMembers)
- Returns:
true
if the members list has changed, false
otherwise
getCacheTopology
public CacheTopology getCacheTopology()
updateCacheTopology
public void updateCacheTopology(CacheTopology newTopology)
needConsistentHashUpdate
public boolean needConsistentHashUpdate()
pruneInvalidMembers
public List<Address> pruneInvalidMembers(List<Address> possibleMembers)
isRebalanceInProgress
public boolean isRebalanceInProgress()
startRebalance
public boolean startRebalance(CacheTopology newTopology)
- Returns:
true
if a rebalance was started, false
if a rebalance was already in progress
confirmRebalanceOnNode
public boolean confirmRebalanceOnNode(Address member,
int receivedTopologyId)
- Returns:
true
if this was the last confirmation needed, false
if more confirmations
are needed or if the rebalance was already confirmed in another way (e.g. members list update)
updateRebalanceMembersList
public boolean updateRebalanceMembersList()
- Should be called after the members list was updated in any other way (
removeMember(Address)
,
updateClusterMembers(java.util.List)
etc.)
- Returns:
true
if the rebalance was confirmed with this update, false
if more confirmations
are needed or if the rebalance was already confirmed in another way (e.g. the last member confirmed)
endRebalance
public void endRebalance()
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.