public class GridCacheAffinityManager extends GridCacheManagerAdapter
| Modifier and Type | Field and Description |
|---|---|
static String |
FAILED_TO_FIND_CACHE_ERR_MSG |
cctx, log| Constructor and Description |
|---|
GridCacheAffinityManager() |
context, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStop, printMemoryStats, start, startInfo, stop, stopInfo, toStringpublic static final String FAILED_TO_FIND_CACHE_ERR_MSG
public void start0()
throws IgniteCheckedException
start0 in class GridCacheManagerAdapterIgniteCheckedException - If failed.protected void onKernalStart0()
throws IgniteCheckedException
onKernalStart0 in class GridCacheManagerAdapterIgniteCheckedException - If failed.protected void onKernalStop0(boolean cancel)
onKernalStop0 in class GridCacheManagerAdaptercancel - Cancel flag.public void cancelFutures()
public void onDisconnected(IgniteFuture reconnectFut)
onDisconnected in interface GridCacheManageronDisconnected in class GridCacheManagerAdapterreconnectFut - Reconnect future.public void onReconnected()
protected void stop0(boolean cancel)
stop0 in class GridCacheManagerAdaptercancel - Cancel flag.public IgniteInternalFuture<AffinityTopologyVersion> affinityReadyFuture(long topVer)
topVer - Topology version to wait.public IgniteInternalFuture<AffinityTopologyVersion> affinityReadyFuture(AffinityTopologyVersion topVer)
topVer - Topology version to wait.@Nullable public IgniteInternalFuture<AffinityTopologyVersion> affinityReadyFuturex(AffinityTopologyVersion topVer)
null if topology with given version is ready by the moment method is invoked.topVer - Topology version to wait.null.public List<List<ClusterNode>> assignments(AffinityTopologyVersion topVer)
topVer - Topology version.public List<List<ClusterNode>> idealAssignment()
public int partitions()
public int partition(Object key)
key - Key.public List<ClusterNode> nodes(Object key, AffinityTopologyVersion topVer)
key - Key.topVer - Topology version.public List<ClusterNode> nodes(int part, AffinityTopologyVersion topVer)
part - Partition.topVer - Topology version.public GridAffinityAssignment assignment(AffinityTopologyVersion topVer)
topVer - Topology version.@Nullable public ClusterNode primary(Object key, AffinityTopologyVersion topVer)
key - Key to check.topVer - Topology version.@Nullable public ClusterNode primary(int part, AffinityTopologyVersion topVer)
part - Partition.topVer - Topology version.public boolean primary(ClusterNode n, Object key, AffinityTopologyVersion topVer)
n - Node to check.key - Key to check.topVer - Topology version.True if checked node is primary for given key.public boolean primary(ClusterNode n, int part, AffinityTopologyVersion topVer)
n - Node to check.part - Partition.topVer - Topology version.True if checked node is primary for given partition.public Collection<ClusterNode> backups(Object key, AffinityTopologyVersion topVer)
key - Key to check.topVer - Topology version.public Collection<ClusterNode> backups(int part, AffinityTopologyVersion topVer)
part - Partition.topVer - Topology version.public boolean backup(ClusterNode n, int part, AffinityTopologyVersion topVer)
n - Node to check.part - Partition.topVer - Topology version.True if checked node is a backup node for given partition.public Collection<ClusterNode> remoteNodes(Iterable keys, AffinityTopologyVersion topVer)
keys - keys.topVer - Topology version.public boolean localNode(Object key, AffinityTopologyVersion topVer)
key - Key to check.topVer - Topology version.true if given key belongs to local node.public boolean localNode(int part,
AffinityTopologyVersion topVer)
part - Partition number to check.topVer - Topology version.true if given partition belongs to local node.public boolean belongs(ClusterNode node, int part, AffinityTopologyVersion topVer)
node - Node.part - Partition number to check.topVer - Topology version.true if given partition belongs to specified node.public Set<Integer> primaryPartitions(UUID nodeId, AffinityTopologyVersion topVer)
nodeId - Node ID.topVer - Topology version to calculate affinity.public Set<Integer> backupPartitions(UUID nodeId, AffinityTopologyVersion topVer)
nodeId - Node ID.topVer - Topology version to calculate affinity.public AffinityTopologyVersion affinityTopologyVersion()
public void dumpDebugInfo()
public GridAffinityAssignmentCache affinityCache()
public boolean primaryChanged(int part,
AffinityTopologyVersion startVer,
AffinityTopologyVersion endVer)
part - Partition.startVer - Start version.endVer - End version.True if primary changed or required affinity version not found in history.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.6.0 Release Date : May 18 2016