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(Object key) |
DistributionInfo |
getDistributionForSegment(int segmentId)
Deprecated.
since 9.3 please use
getSegmentDistribution(int) instead. |
Address |
getLocalAddress() |
IntSet |
getLocalReadSegments() |
Set<Address> |
getMembersSet() |
int |
getSegment(Object key) |
DistributionInfo |
getSegmentDistribution(int segmentId) |
Collection<Address> |
getWriteOwners(Collection<?> keys) |
Collection<Address> |
getWriteOwners(Object key) |
boolean |
isConnected() |
boolean |
isReadOwner(Object key) |
boolean |
isSegmentReadOwner(int segment) |
boolean |
isSegmentWriteOwner(int segment) |
boolean |
isWriteOwner(Object key) |
static LocalizedCacheTopology |
makeSingletonTopology(CacheMode cacheMode,
Address localAddress) |
equals, getActualMembers, getCurrentCH, getMembers, getMembersPersistentUUIDs, getPendingCH, getPhase, getReadConsistentHash, getRebalanceId, getTopologyId, getUnionCH, getWriteConsistentHash, hashCode, logRoutingTableInformation, toString
public 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 boolean isReadOwner(Object key)
true
iff key key
can be read without going remote.public boolean isSegmentReadOwner(int segment)
public boolean isWriteOwner(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(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(Object key)
key
, including the primary owner.public Collection<Address> getWriteOwners(Object key)
key
.public Collection<Address> getWriteOwners(Collection<?> keys)
keys
.public IntSet getLocalReadSegments()
public Address getLocalAddress()
public boolean isConnected()
true
if the local node received this topology from the coordinator,
false
otherwise (e.g. during preload).Copyright © 2020 JBoss, a division of Red Hat. All rights reserved.