public class GridAffinityAssignmentCache extends Object
| Constructor and Description |
|---|
GridAffinityAssignmentCache(GridKernalContext ctx,
String cacheOrGrpName,
int grpId,
AffinityFunction aff,
IgnitePredicate<ClusterNode> nodeFilter,
int backups,
boolean locCache)
Constructs affinity cached calculations.
|
public GridAffinityAssignmentCache(GridKernalContext ctx, String cacheOrGrpName, int grpId, AffinityFunction aff, IgnitePredicate<ClusterNode> nodeFilter, int backups, boolean locCache)
ctx - Kernal context.cacheOrGrpName - Cache or cache group name.grpId - Group ID.aff - Affinity function.nodeFilter - Node filter.backups - Number of backups.locCache - Local cache flag.public Object similarAffinityKey()
public String cacheOrGroupName()
public int groupId()
public void initialize(AffinityTopologyVersion topVer, List<List<ClusterNode>> affAssignment)
topVer - Topology version.affAssignment - Affinity assignment for topology version.public void idealAssignment(AffinityTopologyVersion topVer, List<List<ClusterNode>> assignment)
assignment - Assignment.@Nullable public @Nullable List<List<ClusterNode>> idealAssignmentRaw()
@Nullable public @Nullable IdealAffinityAssignment idealAssignment()
public boolean centralizedAffinityFunction()
True if affinity function has AffinityCentralizedFunction annotation.public void cancelFutures(IgniteCheckedException err)
err - Error.public void onReconnected()
public IdealAffinityAssignment calculate(AffinityTopologyVersion topVer, @Nullable @Nullable ExchangeDiscoveryEvents events, @Nullable @Nullable DiscoCache discoCache)
topVer - Topology version to calculate affinity cache for.events - Discovery events that caused this topology version change.discoCache - Discovery cache.public void clientEventTopologyChange(DiscoveryEvent evt, AffinityTopologyVersion topVer)
evt - Event.topVer - Topology version.public AffinityTopologyVersion lastVersion()
public AffinityAssignment lastReadyAffinity()
public List<List<ClusterNode>> assignments(AffinityTopologyVersion topVer)
topVer - Topology version.public List<List<ClusterNode>> readyAssignments(AffinityTopologyVersion topVer)
topVer - Topology version.@Nullable public @Nullable 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> partitionPrimariesDifferentToIdeal(AffinityTopologyVersion topVer)
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 boolean dumpDebugInfo()
True if there are pending futures.public AffinityAssignment readyAffinity(AffinityTopologyVersion topVer)
topVer - Topology version.public AffinityAssignment cachedAffinity(AffinityTopologyVersion topVer)
topVer - Topology version.public AffinityAssignment cachedAffinity(AffinityTopologyVersion topVer, AffinityTopologyVersion lastAffChangeTopVer)
topVer - Topology version for which affinity assignment is requested.lastAffChangeTopVer - Topology version of last affinity assignment change.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.public NavigableSet<AffinityTopologyVersion> cachedVersions()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.1 Release Date : December 9 2020