public class GridAffinityAssignmentCache extends Object
| Constructor and Description |
|---|
GridAffinityAssignmentCache(GridKernalContext ctx,
String cacheOrGrpName,
int grpId,
AffinityFunction aff,
IgnitePredicate<ClusterNode> nodeFilter,
int backups,
boolean locCache,
boolean persistentCache)
Constructs affinity cached calculations.
|
public GridAffinityAssignmentCache(GridKernalContext ctx, String cacheOrGrpName, int grpId, AffinityFunction aff, IgnitePredicate<ClusterNode> nodeFilter, int backups, boolean locCache, boolean persistentCache)
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(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, @Nullable ExchangeDiscoveryEvents events, @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 List<List<ClusterNode>> assignments(AffinityTopologyVersion topVer)
topVer - Topology version.public List<List<ClusterNode>> readyAssignments(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 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 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 Collection<AffinityTopologyVersion> cachedVersions()
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018