org.apache.ignite.internal.processors.cache.persistence.partstate

## Class PartitionAllocationMap

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.partstate.PartitionAllocationMap

    public class PartitionAllocationMap
    extends Object

Information structure with partitions state. Page counts map.

### Constructor Summary

Constructors
Constructor and Description
`PartitionAllocationMap()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `containsKey(GroupPartitionId key)`
`static GroupPartitionId` `createCachePartId(FullPageId fullId)` Extracts partition information from full page ID
`Set<Map.Entry<GroupPartitionId,PagesAllocationRange>>` `entrySet()`
`GroupPartitionId` `firstKey()`
`boolean` `forceSkipIndexPartition(int grpId)` Forces the index partition for the given group ID to be skipped in collected map.
`PagesAllocationRange` `get(FullPageId fullPageId)`
`PagesAllocationRange` `get(GroupPartitionId key)` Returns the value to which the specified key is mapped, or `null` if this map contains no mapping for the key.
`boolean` `isEmpty()`
`Set<GroupPartitionId>` `keySet()`
`GroupPartitionId` `nextKey(GroupPartitionId key)` Returns next (higher) key for provided cache and partition or null
`void` `prepareForSnapshot()` Prepare map for snapshot.
`PagesAllocationRange` `put(GroupPartitionId key, PagesAllocationRange val)`
`int` `size()`
`String` `toString()`
`Iterable<PagesAllocationRange>` `values()`

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

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

### Constructor Detail

#### PartitionAllocationMap

    public PartitionAllocationMap()

### Method Detail

#### get

    @Nullable
    public PagesAllocationRange get(GroupPartitionId key)

Returns the value to which the specified key is mapped, or `null` if this map contains no mapping for the key.

Parameters:
  `key` - to get
Returns:
  value or null

#### get

    @Nullable
    public PagesAllocationRange get(FullPageId fullPageId)

Parameters:
  `fullPageId` - Full page id.

#### createCachePartId

    @NotNull
    public static GroupPartitionId createCachePartId(@NotNull
                                                              FullPageId fullId)

Extracts partition information from full page ID

Parameters:
  `fullId` - page related to some cache
Returns:
  pair of cache ID and partition ID

#### isEmpty

    public boolean isEmpty()

Returns:
  `true` if this map contains no key-value mappings

#### size

    public int size()

Returns:
  the number of key-value mappings in this map.

#### keySet

    public Set<GroupPartitionId> keySet()

Returns:
  keys (all caches partitions)

#### values

    public Iterable<PagesAllocationRange> values()

Returns:
  values (allocation ranges)

#### firstKey

    public GroupPartitionId firstKey()

Returns:
  Returns the first (lowest) key currently in this map.

#### forceSkipIndexPartition

    public boolean forceSkipIndexPartition(int grpId)

Forces the index partition for the given group ID to be skipped in collected map.

Parameters:
  `grpId` - Group ID to skip.
Returns:
  `true` if skipped partition was added to the ignore list during this call.

#### nextKey

    @Nullable
    public GroupPartitionId nextKey(@NotNull
                                              GroupPartitionId key)

Returns next (higher) key for provided cache and partition or null

Parameters:
  `key` - cache and partition to search
Returns:
  first found key which is greater than provided

#### entrySet

    public Set<Map.Entry<GroupPartitionId,PagesAllocationRange>> entrySet()

Returns:
  set view of the mappings contained in this map, sorted in ascending key order

#### containsKey

    public boolean containsKey(GroupPartitionId key)

Returns:
  `true` if this map contains a mapping for the specified key

#### put

    public PagesAllocationRange put(GroupPartitionId key,
                                    PagesAllocationRange val)

Parameters:
  `key` - key with which the specified value is to be associated
  `val` - value to be associated with the specified key
Returns:
  the previous value associated with `key`, or `null` if there was no mapping for `key`.

#### prepareForSnapshot

    public void prepareForSnapshot()

Prepare map for snapshot.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.0
Release Date | : November 30 2018