Package org.apache.ignite.internal.processors.affinity

## Class IdealAffinityAssignment

- java.lang.Object
- - org.apache.ignite.internal.processors.affinity.IdealAffinityAssignment

    public class IdealAffinityAssignment
    extends Object

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`List<List<ClusterNode>>` `assignment()`
`static Map<Object,​Set<Integer>>` `calculatePrimaries​(@Nullable List<ClusterNode> nodes, List<List<ClusterNode>> assignment)`
`static IdealAffinityAssignment` `create​(AffinityTopologyVersion topVer, @Nullable List<ClusterNode> nodes, List<List<ClusterNode>> assignment)`
`static IdealAffinityAssignment` `create​(AffinityTopologyVersion topVer, List<List<ClusterNode>> assignment)`
`static IdealAffinityAssignment` `createWithPreservedPrimaries​(AffinityTopologyVersion topVer, List<List<ClusterNode>> assignment, IdealAffinityAssignment previousAssignment)`
`ClusterNode` `currentPrimary​(int partition)`
`Set<Integer>` `idealPrimaries​(ClusterNode clusterNode)`
`AffinityTopologyVersion` `topologyVersion()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### idealPrimaries

    public Set<Integer> idealPrimaries​(ClusterNode clusterNode)

Parameters:
  `clusterNode` - Cluster node.

#### currentPrimary

    public ClusterNode currentPrimary​(int partition)

Parameters:
  `partition` - Partition.

#### assignment

    public List<List<ClusterNode>> assignment()

#### topologyVersion

    public AffinityTopologyVersion topologyVersion()

#### calculatePrimaries

    public static Map<Object,​Set<Integer>> calculatePrimaries​(@Nullable
                                                                    @Nullable List<ClusterNode> nodes,
                                                                    List<List<ClusterNode>> assignment)

Parameters:
  `nodes` - Nodes.
  `assignment` - Assignment.

#### create

    public static IdealAffinityAssignment create​(AffinityTopologyVersion topVer,
                                                 List<List<ClusterNode>> assignment)

Parameters:
  `topVer` - Topology version.
  `assignment` - Assignment.

#### create

    public static IdealAffinityAssignment create​(AffinityTopologyVersion topVer,
                                                 @Nullable
                                                 @Nullable List<ClusterNode> nodes,
                                                 List<List<ClusterNode>> assignment)

Parameters:
  `topVer` - Topology version.
  `nodes` - Nodes.
  `assignment` - Assignment.

#### createWithPreservedPrimaries

    public static IdealAffinityAssignment createWithPreservedPrimaries​(AffinityTopologyVersion topVer,
                                                                       List<List<ClusterNode>> assignment,
                                                                       IdealAffinityAssignment previousAssignment)

Parameters:
  `topVer` - Topology version.
  `assignment` - Assignment.
  `previousAssignment` - Previous assignment.