public class GridAffinityAssignmentCache extends Object
| Constructor and Description |
|---|
GridAffinityAssignmentCache(GridKernalContext ctx,
String cacheName,
AffinityFunction aff,
IgnitePredicate<ClusterNode> nodeFilter,
int backups,
boolean locCache)
Constructs affinity cached calculations.
|
| Modifier and Type | Method and Description |
|---|---|
List<List<ClusterNode>> |
assignments(AffinityTopologyVersion topVer) |
Set<Integer> |
backupPartitions(UUID nodeId,
AffinityTopologyVersion topVer)
Get backup partitions for specified node ID.
|
GridAffinityAssignment |
cachedAffinity(AffinityTopologyVersion topVer)
Get cached affinity for specified topology version.
|
Integer |
cacheId() |
String |
cacheName() |
List<List<ClusterNode>> |
calculate(AffinityTopologyVersion topVer,
DiscoveryEvent discoEvt)
Calculates affinity cache for given topology version.
|
void |
cancelFutures(IgniteCheckedException err)
Kernal stop callback.
|
boolean |
centralizedAffinityFunction() |
void |
clientEventTopologyChange(DiscoveryEvent evt,
AffinityTopologyVersion topVer)
Copies previous affinity assignment when discovery event does not cause affinity assignment changes
(e.g. client node joins on leaves).
|
void |
dumpDebugInfo()
Dumps debug information.
|
List<List<ClusterNode>> |
idealAssignment() |
void |
idealAssignment(List<List<ClusterNode>> assignment) |
void |
init(GridAffinityAssignmentCache aff) |
void |
initialize(AffinityTopologyVersion topVer,
List<List<ClusterNode>> affAssignment)
Initializes affinity with given topology version and assignment.
|
AffinityTopologyVersion |
lastVersion() |
List<ClusterNode> |
nodes(int part,
AffinityTopologyVersion topVer)
Gets affinity nodes for specified partition.
|
void |
onReconnected() |
int |
partitions() |
boolean |
primaryChanged(int part,
AffinityTopologyVersion startVer,
AffinityTopologyVersion endVer) |
Set<Integer> |
primaryPartitions(UUID nodeId,
AffinityTopologyVersion topVer)
Get primary partitions for specified node ID.
|
IgniteInternalFuture<AffinityTopologyVersion> |
readyFuture(AffinityTopologyVersion topVer)
Gets future that will be completed after topology with version
topVer is calculated. |
public GridAffinityAssignmentCache(GridKernalContext ctx, String cacheName, AffinityFunction aff, IgnitePredicate<ClusterNode> nodeFilter, int backups, boolean locCache)
ctx - Kernal context.cacheName - Cache name.aff - Affinity function.nodeFilter - Node filter.backups - Number of backups.locCache - Local cache flag.public String cacheName()
public Integer cacheId()
public void initialize(AffinityTopologyVersion topVer, List<List<ClusterNode>> affAssignment)
topVer - Topology version.affAssignment - Affinity assignment for topology version.public void idealAssignment(List<List<ClusterNode>> assignment)
assignment - Assignment.@Nullable public List<List<ClusterNode>> idealAssignment()
public boolean centralizedAffinityFunction()
True if affinity function has AffinityCentralizedFunction annotation.public void cancelFutures(IgniteCheckedException err)
err - Error.public void onReconnected()
public List<List<ClusterNode>> calculate(AffinityTopologyVersion topVer, DiscoveryEvent discoEvt)
topVer - Topology version to calculate affinity cache for.discoEvt - Discovery event that caused this topology version change.public void clientEventTopologyChange(DiscoveryEvent evt, AffinityTopologyVersion topVer)
evt - Event.topVer - Topology version.public AffinityTopologyVersion lastVersion()
public List<List<ClusterNode>> assignments(AffinityTopologyVersion topVer)
topVer - Topology version.@Nullable public IgniteInternalFuture<AffinityTopologyVersion> readyFuture(AffinityTopologyVersion topVer)
topVer is calculated.topVer - Topology version to await for.topVer is calculated.public int partitions()
public List<ClusterNode> nodes(int part, AffinityTopologyVersion topVer)
part - Partition.topVer - Topology version.public Set<Integer> primaryPartitions(UUID nodeId, AffinityTopologyVersion topVer)
nodeId - Node ID to get primary partitions for.topVer - Topology version.public Set<Integer> backupPartitions(UUID nodeId, AffinityTopologyVersion topVer)
nodeId - Node ID to get backup partitions for.topVer - Topology version.public void dumpDebugInfo()
public GridAffinityAssignment cachedAffinity(AffinityTopologyVersion topVer)
topVer - Topology version.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.public void init(GridAffinityAssignmentCache aff)
aff - Affinity cache.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.6.0 Release Date : May 18 2016