Class HistoryAffinityAssignmentShallowCopy
- java.lang.Object
-
- org.apache.ignite.internal.processors.affinity.HistoryAffinityAssignmentShallowCopy
-
- All Implemented Interfaces:
AffinityAssignment,HistoryAffinityAssignment
public class HistoryAffinityAssignmentShallowCopy extends Object implements HistoryAffinityAssignment
Shallow copy that contains reference to delegateHistoryAffinityAssignment.
-
-
Field Summary
-
Fields inherited from interface org.apache.ignite.internal.processors.affinity.AffinityAssignment
DFLT_AFFINITY_BACKUPS_THRESHOLD, IGNITE_AFFINITY_BACKUPS_THRESHOLD, IGNITE_DISABLE_AFFINITY_MEMORY_OPTIMIZATION
-
-
Constructor Summary
Constructors Constructor Description HistoryAffinityAssignmentShallowCopy(HistoryAffinityAssignment histAssignment, AffinityTopologyVersion topVer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<List<ClusterNode>>assignment()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()booleanisFullSizeInstance()Should return true if instance is "heavy" and should be taken into account during history size management.Set<ClusterNode>nodes()HistoryAffinityAssignmentorigin()In case this instance is lightweight wrapper of another instance, this method should return reference to an original one.Set<Integer>partitionPrimariesDifferentToIdeal()Set<ClusterNode>primaryPartitionNodes()Set<Integer>primaryPartitions(UUID nodeId)Get primary partitions for specified node ID.AffinityTopologyVersiontopologyVersion()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.processors.affinity.AffinityAssignment
assignments2ids
-
-
-
-
Constructor Detail
-
HistoryAffinityAssignmentShallowCopy
public HistoryAffinityAssignmentShallowCopy(HistoryAffinityAssignment histAssignment, AffinityTopologyVersion topVer)
- Parameters:
histAssignment- History assignment.topVer- Topology version.
-
-
Method Detail
-
isFullSizeInstance
public boolean isFullSizeInstance()
Should return true if instance is "heavy" and should be taken into account during history size management.- Specified by:
isFullSizeInstancein interfaceHistoryAffinityAssignment- Returns:
trueif adding this instance to history should trigger size check and possible cleanup.
-
idealAssignment
public List<List<ClusterNode>> idealAssignment()
- Specified by:
idealAssignmentin interfaceAffinityAssignment- Returns:
- Affinity assignment computed by affinity function.
-
assignment
public List<List<ClusterNode>> assignment()
- Specified by:
assignmentin interfaceAffinityAssignment- Returns:
- Affinity assignment.
-
topologyVersion
public AffinityTopologyVersion topologyVersion()
- Specified by:
topologyVersionin interfaceAffinityAssignment- Returns:
- Topology version.
-
get
public List<ClusterNode> get(int part)
Get affinity nodes for partition.- Specified by:
getin interfaceAffinityAssignment- Parameters:
part- Partition.- Returns:
- Affinity nodes.
-
getIds
public Collection<UUID> getIds(int part)
Get affinity node IDs for partition.- Specified by:
getIdsin interfaceAffinityAssignment- Parameters:
part- Partition.- Returns:
- Affinity nodes IDs.
-
nodes
public Set<ClusterNode> nodes()
- Specified by:
nodesin interfaceAffinityAssignment- Returns:
- Nodes having primary and backup assignments.
-
primaryPartitionNodes
public Set<ClusterNode> primaryPartitionNodes()
- Specified by:
primaryPartitionNodesin interfaceAffinityAssignment- Returns:
- Nodes having primary partitions assignments.
-
primaryPartitions
public Set<Integer> primaryPartitions(UUID nodeId)
Get primary partitions for specified node ID.- Specified by:
primaryPartitionsin interfaceAffinityAssignment- Parameters:
nodeId- Node ID to get primary partitions for.- Returns:
- Primary partitions for specified node ID.
-
backupPartitions
public Set<Integer> backupPartitions(UUID nodeId)
Get backup partitions for specified node ID.- Specified by:
backupPartitionsin interfaceAffinityAssignment- Parameters:
nodeId- Node ID to get backup partitions for.- Returns:
- Backup partitions for specified node ID.
-
partitionPrimariesDifferentToIdeal
public Set<Integer> partitionPrimariesDifferentToIdeal()
- Specified by:
partitionPrimariesDifferentToIdealin interfaceAffinityAssignment- Returns:
- Set of partitions which primary is different to primary in ideal assignment.
-
origin
public HistoryAffinityAssignment origin()
In case this instance is lightweight wrapper of another instance, this method should return reference to an original one. Otherwise, it should returnthisreference.- Specified by:
originin interfaceHistoryAffinityAssignment- Returns:
- Original instance of
thisif not applicable.
-
-