public class LocalizedCacheTopology extends CacheTopology
CacheTopology with information about keys owned by the local node.CacheTopology.Externalizer, CacheTopology.Phase| Constructor and Description |
|---|
LocalizedCacheTopology(CacheMode cacheMode,
CacheTopology cacheTopology,
KeyPartitioner keyPartitioner,
Address localAddress,
boolean connected) |
| Modifier and Type | Method and Description |
|---|---|
DistributionInfo |
getDistribution(java.lang.Object key) |
DistributionInfo |
getDistributionForSegment(int segmentId)
Deprecated.
since 9.3 please use
getSegmentDistribution(int) instead. |
Address |
getLocalAddress() |
IntSet |
getLocalReadSegments() |
java.util.Set<Address> |
getMembersSet() |
int |
getSegment(java.lang.Object key) |
DistributionInfo |
getSegmentDistribution(int segmentId) |
java.util.Collection<Address> |
getWriteOwners(java.util.Collection<?> keys) |
java.util.Collection<Address> |
getWriteOwners(java.lang.Object key) |
boolean |
isConnected() |
boolean |
isReadOwner(java.lang.Object key) |
boolean |
isSegmentReadOwner(int segment) |
boolean |
isSegmentWriteOwner(int segment) |
boolean |
isWriteOwner(java.lang.Object key) |
static LocalizedCacheTopology |
makeSegmentedSingletonTopology(KeyPartitioner keyPartitioner,
int numSegments,
Address localAddress)
Creates a new local topology that has a single address but multiple segments.
|
static LocalizedCacheTopology |
makeSingletonTopology(CacheMode cacheMode,
Address localAddress) |
equals, getActualMembers, getCurrentCH, getMembers, getMembersPersistentUUIDs, getPendingCH, getPhase, getReadConsistentHash, getRebalanceId, getTopologyId, getUnionCH, getWriteConsistentHash, hashCode, logRoutingTableInformation, toStringpublic LocalizedCacheTopology(CacheMode cacheMode, CacheTopology cacheTopology, KeyPartitioner keyPartitioner, Address localAddress, boolean connected)
public static LocalizedCacheTopology makeSingletonTopology(CacheMode cacheMode, Address localAddress)
cacheMode - Ignored, the result topology is always LOCALlocalAddress - Address of the local nodepublic static LocalizedCacheTopology makeSegmentedSingletonTopology(KeyPartitioner keyPartitioner, int numSegments, Address localAddress)
keyPartitioner - partitioner to decide which segment a given key maps tonumSegments - how many segments there arelocalAddress - the address of this nodepublic boolean isReadOwner(java.lang.Object key)
true iff key key can be read without going remote.public boolean isSegmentReadOwner(int segment)
public boolean isWriteOwner(java.lang.Object key)
true iff writing a value for key key will update it on the local node.public boolean isSegmentWriteOwner(int segment)
public int getSegment(java.lang.Object key)
key@Deprecated public DistributionInfo getDistributionForSegment(int segmentId)
getSegmentDistribution(int) instead.segment, including the primary owner.public DistributionInfo getSegmentDistribution(int segmentId)
public DistributionInfo getDistribution(java.lang.Object key)
key, including the primary owner.public java.util.Collection<Address> getWriteOwners(java.lang.Object key)
key.public java.util.Collection<Address> getWriteOwners(java.util.Collection<?> keys)
keys.public IntSet getLocalReadSegments()
public Address getLocalAddress()
public java.util.Set<Address> getMembersSet()
public boolean isConnected()
true if the local node received this topology from the coordinator,
false otherwise (e.g. during preload).