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) |
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(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 © 2021 JBoss by Red Hat. All rights reserved.