Interface AffinityAssignment
-
- All Known Subinterfaces:
HistoryAffinityAssignment
- All Known Implementing Classes:
GridAffinityAssignment,GridAffinityAssignmentV2,HistoryAffinityAssignmentImpl,HistoryAffinityAssignmentShallowCopy
public interface AffinityAssignmentCached affinity calculations.
-
-
Field Summary
Fields Modifier and Type Field Description static intDFLT_AFFINITY_BACKUPS_THRESHOLDstatic intIGNITE_AFFINITY_BACKUPS_THRESHOLDSize threshold to use Map instead of List view.static booleanIGNITE_DISABLE_AFFINITY_MEMORY_OPTIMIZATIONDisable memory affinity optimizations.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<List<ClusterNode>>assignment()default Collection<UUID>assignments2ids(List<ClusterNode> assignmentPart)Converts List of Cluster Nodes to HashSet of UUIDs wrapped as unmodifiable collection.Set<Integer>backupPartitions(UUID nodeId)Get backup partitions for specified node ID.List<ClusterNode>get(int part)Get affinity nodes for partition.Collection<UUID>getIds(int part)Get affinity node IDs for partition.List<List<ClusterNode>>idealAssignment()Set<ClusterNode>nodes()Set<Integer>partitionPrimariesDifferentToIdeal()Set<ClusterNode>primaryPartitionNodes()Set<Integer>primaryPartitions(UUID nodeId)Get primary partitions for specified node ID.AffinityTopologyVersiontopologyVersion()
-
-
-
Field Detail
-
DFLT_AFFINITY_BACKUPS_THRESHOLD
static final int DFLT_AFFINITY_BACKUPS_THRESHOLD
-
IGNITE_AFFINITY_BACKUPS_THRESHOLD
static final int IGNITE_AFFINITY_BACKUPS_THRESHOLD
Size threshold to use Map instead of List view.
-
IGNITE_DISABLE_AFFINITY_MEMORY_OPTIMIZATION
static final boolean IGNITE_DISABLE_AFFINITY_MEMORY_OPTIMIZATION
Disable memory affinity optimizations.
-
-
Method Detail
-
idealAssignment
List<List<ClusterNode>> idealAssignment()
- Returns:
- Affinity assignment computed by affinity function.
-
assignment
List<List<ClusterNode>> assignment()
- Returns:
- Affinity assignment.
-
topologyVersion
AffinityTopologyVersion topologyVersion()
- Returns:
- Topology version.
-
get
List<ClusterNode> get(int part)
Get affinity nodes for partition.- Parameters:
part- Partition.- Returns:
- Affinity nodes.
-
getIds
Collection<UUID> getIds(int part)
Get affinity node IDs for partition.- Parameters:
part- Partition.- Returns:
- Affinity nodes IDs.
-
nodes
Set<ClusterNode> nodes()
- Returns:
- Nodes having primary and backup assignments.
-
primaryPartitionNodes
Set<ClusterNode> primaryPartitionNodes()
- Returns:
- Nodes having primary partitions assignments.
-
primaryPartitions
Set<Integer> primaryPartitions(UUID nodeId)
Get primary partitions for specified node ID.- Parameters:
nodeId- Node ID to get primary partitions for.- Returns:
- Primary partitions for specified node ID.
-
backupPartitions
Set<Integer> backupPartitions(UUID nodeId)
Get backup partitions for specified node ID.- Parameters:
nodeId- Node ID to get backup partitions for.- Returns:
- Backup partitions for specified node ID.
-
partitionPrimariesDifferentToIdeal
Set<Integer> partitionPrimariesDifferentToIdeal()
- Returns:
- Set of partitions which primary is different to primary in ideal assignment.
-
assignments2ids
default Collection<UUID> assignments2ids(List<ClusterNode> assignmentPart)
Converts List of Cluster Nodes to HashSet of UUIDs wrapped as unmodifiable collection.- Parameters:
assignmentPart- Source assignment per partition.- Returns:
- List of deduplicated collections if ClusterNode's ids.
-
-