org.apache.ignite.internal.processors.affinity

## Interface AffinityAssignment

All Known Implementing Classes:
  GridAffinityAssignment, HistoryAffinityAssignment

    public interface AffinityAssignment

Cached affinity calculations.

### Method Summary

Methods
`List<List<ClusterNode>>` `assignment()`
`Set<Integer>` `backupPartitions(UUID nodeId)` Get backup partitions for specified node ID.
`boolean` `clientEventChange()`
`List<ClusterNode>` `get(int part)` Get affinity nodes for partition.
`HashSet<UUID>` `getIds(int part)` Get affinity node IDs for partition.
`List<List<ClusterNode>>` `idealAssignment()`
`Set<ClusterNode>` `primaryPartitionNodes()`
`Set<Integer>` `primaryPartitions(UUID nodeId)` Get primary partitions for specified node ID.
`AffinityTopologyVersion` `topologyVersion()`

### Method Detail

#### clientEventChange

    boolean clientEventChange()

Returns:
  `True` if related discovery event did not not cause affinity assignment change and this assignment is just reference to the previous one.

#### 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

    HashSet<UUID> getIds(int part)

Get affinity node IDs for partition.

Parameters:
  `part` - Partition.
Returns:
  Affinity nodes IDs.

#### 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.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.0.0
Release Date | : April 30 2017