org.apache.ignite.internal.processors.cache.distributed.dht.preloader

## Class GridDhtPartitionMap2

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2

All Implemented Interfaces:
  Externalizable, Serializable, Comparable<GridDhtPartitionMap2>

Direct Known Subclasses:
  GridDhtPartitionMap

    public class GridDhtPartitionMap2
    extends Object
    implements Comparable<GridDhtPartitionMap2>, Externalizable

Partition map.

See Also:
  Serialized Form

### Field Summary

Fields
`protected Map<Integer,GridDhtPartitionState>` `map`
`protected UUID` `nodeId` Node ID.
`static IgniteProductVersion` `SINCE` Used since.
`protected AffinityTopologyVersion` `top` Topology version.
`protected long` `updateSeq` Update sequence number.

### Constructor Summary

Constructors
Constructor and Description
`GridDhtPartitionMap2()` Empty constructor required for `Externalizable`.
`GridDhtPartitionMap2(UUID nodeId, long updateSeq)`
`GridDhtPartitionMap2(UUID nodeId, long updateSeq, AffinityTopologyVersion top, Map<Integer,GridDhtPartitionState> m, boolean onlyActive)`

### Method Summary

Methods
`int` `compareTo(GridDhtPartitionMap2 o)`
`boolean` `containsKey(Integer part)`
`Set<Map.Entry<Integer,GridDhtPartitionState>>` `entrySet()`
`boolean` `equals(Object o)`
`GridDhtPartitionState` `get(Integer part)`
`int` `hashCode()`
`boolean` `hasMovingPartitions()`
`Set<Integer>` `keySet()`
`Map<Integer,GridDhtPartitionState>` `map()`
`UUID` `nodeId()`
`void` `put(Integer part, GridDhtPartitionState state)`
`void` `readExternal(ObjectInput in)`
`int` `size()`
`String` `toFullString()`
`AffinityTopologyVersion` `topologyVersion()`
`String` `toString()`
`long` `updateSequence()`
`long` `updateSequence(long updateSeq)`
`void` `writeExternal(ObjectOutput out)`

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### SINCE

    public static final IgniteProductVersion SINCE

Used since.

#### nodeId

    protected UUID nodeId

Node ID.

#### updateSeq

    protected long updateSeq

Update sequence number.

#### top

    protected AffinityTopologyVersion top

Topology version.

#### map

    protected Map<Integer,GridDhtPartitionState> map

### Constructor Detail

#### GridDhtPartitionMap2

    public GridDhtPartitionMap2(UUID nodeId,
                        long updateSeq)

Parameters:
  `nodeId` - Node ID.
  `updateSeq` - Update sequence number.

#### GridDhtPartitionMap2

    public GridDhtPartitionMap2(UUID nodeId,
                        long updateSeq,
                        AffinityTopologyVersion top,
                        Map<Integer,GridDhtPartitionState> m,
                        boolean onlyActive)

Parameters:
  `nodeId` - Node ID.
  `updateSeq` - Update sequence number.
  `m` - Map to copy.
  `onlyActive` - If `true`, then only active states will be included.

#### GridDhtPartitionMap2

    public GridDhtPartitionMap2()

Empty constructor required for `Externalizable`.

### Method Detail

#### put

    public void put(Integer part,
           GridDhtPartitionState state)

Parameters:
  `part` - Partition.
  `state` - Partition state.

#### hasMovingPartitions

    public boolean hasMovingPartitions()

Returns:
  `true` If partition map contains moving partitions.

#### get

    public GridDhtPartitionState get(Integer part)

Parameters:
  `part` - Partition.
Returns:
  Partition state.

#### containsKey

    public boolean containsKey(Integer part)

Parameters:
  `part` - Partition.
Returns:
  `True` if contains given partition.

#### entrySet

    public Set<Map.Entry<Integer,GridDhtPartitionState>> entrySet()

Returns:
  Entries.

#### size

    public int size()

Returns:
  Map size.

#### keySet

    public Set<Integer> keySet()

Returns:
  Partitions.

#### map

    public Map<Integer,GridDhtPartitionState> map()

Returns:
  Underlying map.

#### nodeId

    public UUID nodeId()

Returns:
  Node ID.

#### updateSequence

    public long updateSequence()

Returns:
  Update sequence.

#### updateSequence

    public long updateSequence(long updateSeq)

Parameters:
  `updateSeq` - New update sequence value.
Returns:
  Old update sequence value.

#### topologyVersion

    public AffinityTopologyVersion topologyVersion()

Returns:
  Topology version.

#### compareTo

    public int compareTo(GridDhtPartitionMap2 o)

Specified by:
  `compareTo` in interface `Comparable<GridDhtPartitionMap2>`

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toFullString

    public String toFullString()

Returns:
  Full string representation.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0-b1
Release Date | : December 1 2015