public class GridCacheAffinityManager extends GridCacheManagerAdapter
cctx, log| Constructor and Description |
|---|
GridCacheAffinityManager() |
| Modifier and Type | Method and Description |
|---|---|
IgniteInternalFuture<Long> |
affinityReadyFuture(long topVer)
Gets affinity ready future, a future that will be completed after affinity with given
topology version is calculated.
|
IgniteInternalFuture<Long> |
affinityReadyFuturex(long topVer)
Gets affinity ready future that will be completed after affinity with given topology version is calculated.
|
long |
affinityTopologyVersion() |
List<List<ClusterNode>> |
assignments(long topVer) |
Set<Integer> |
backupPartitions(UUID nodeId,
long topVer) |
Collection<ClusterNode> |
backups(int part,
long topVer) |
Collection<ClusterNode> |
backups(Object key,
long topVer) |
boolean |
belongs(ClusterNode node,
int part,
long topVer) |
boolean |
belongs(ClusterNode node,
Object key,
long topVer) |
List<List<ClusterNode>> |
calculateAffinity(long topVer,
DiscoveryEvent discoEvt)
Calculates affinity cache for given topology version.
|
void |
cleanUpCache(long topVer)
Clean up outdated cache items.
|
void |
initializeAffinity(long topVer,
List<List<ClusterNode>> affAssignment)
Initializes affinity for joined node.
|
boolean |
localNode(int part,
long topVer) |
boolean |
localNode(Object key,
long topVer) |
List<ClusterNode> |
nodes(int part,
long topVer) |
List<ClusterNode> |
nodes(Object key,
long topVer) |
protected void |
onKernalStart0() |
protected void |
onKernalStop0(boolean cancel) |
<T> int |
partition(Object key)
NOTE: Use this method always when you need to calculate partition id for
a key provided by user.
|
GridPartitionLockKey |
partitionAffinityKey(int partId)
Gets partition affinity key for given partition id.
|
int |
partitions() |
boolean |
primary(ClusterNode n,
int part,
long topVer) |
boolean |
primary(ClusterNode n,
Object key,
long topVer) |
ClusterNode |
primary(int part,
long topVer) |
ClusterNode |
primary(Object key,
long topVer) |
Set<Integer> |
primaryPartitions(UUID nodeId,
long topVer) |
Collection<ClusterNode> |
remoteNodes(Iterable keys,
long topVer) |
void |
start0() |
protected void |
stop0(boolean cancel) |
context, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStop, printMemoryStats, start, startInfo, stop, stopInfo, toStringpublic 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.protected void stop0(boolean cancel)
stop0 in class GridCacheManagerAdaptercancel - Cancel flag.public IgniteInternalFuture<Long> affinityReadyFuture(long topVer)
topVer - Topology version to wait.@Nullable public IgniteInternalFuture<Long> affinityReadyFuturex(long topVer)
null if topology with given version is ready by the moment method is invoked.topVer - Topology version to wait.null.public void cleanUpCache(long topVer)
topVer - Actual topology version, older versions will be removed.public void initializeAffinity(long topVer,
List<List<ClusterNode>> affAssignment)
topVer - Topology version.affAssignment - Affinity assignment for this topology version.public List<List<ClusterNode>> assignments(long topVer)
topVer - Topology version.public List<List<ClusterNode>> calculateAffinity(long topVer, DiscoveryEvent discoEvt)
topVer - Topology version to calculate affinity for.discoEvt - Discovery event that causes this topology change.public int partitions()
public GridPartitionLockKey partitionAffinityKey(int partId)
partId - Partition ID.public <T> int partition(Object key)
key - Key.public List<ClusterNode> nodes(Object key, long topVer)
key - Key.topVer - Topology version.public List<ClusterNode> nodes(int part, long topVer)
part - Partition.topVer - Topology version.@Nullable public ClusterNode primary(Object key, long topVer)
key - Key to check.topVer - Topology version.@Nullable public ClusterNode primary(int part, long topVer)
part - Partition.topVer - Topology version.public boolean primary(ClusterNode n, Object key, long 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, long topVer)
n - Node to check.part - Partition.topVer - Topology version.True if checked node is primary for given key.public Collection<ClusterNode> backups(Object key, long topVer)
key - Key to check.topVer - Topology version.public Collection<ClusterNode> backups(int part, long topVer)
part - Partition.topVer - Topology version.public Collection<ClusterNode> remoteNodes(Iterable keys, long topVer)
keys - keys.topVer - Topology version.public boolean localNode(Object key, long topVer)
key - Key to check.topVer - Topology version.true if given key belongs to local node.public boolean localNode(int part,
long topVer)
part - Partition number to check.topVer - Topology version.true if given partition belongs to local node.public boolean belongs(ClusterNode node, int part, long topVer)
node - Node.part - Partition number to check.topVer - Topology version.true if given partition belongs to specified node.public boolean belongs(ClusterNode node, Object key, long topVer)
node - Node.key - Key to check.topVer - Topology version.true if given key belongs to specified node.public Set<Integer> primaryPartitions(UUID nodeId, long topVer)
nodeId - Node ID.topVer - Topology version to calculate affinity.public Set<Integer> backupPartitions(UUID nodeId, long topVer)
nodeId - Node ID.topVer - Topology version to calculate affinity.public long affinityTopologyVersion()
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015