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 Description PartitionAllocationMap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(GroupPartitionId key)static @NotNull GroupPartitionIdcreateCachePartId(@NotNull FullPageId fullId)Extracts partition information from full page IDSet<Map.Entry<GroupPartitionId,PagesAllocationRange>>entrySet()GroupPartitionIdfirstKey()booleanforceSkipIndexPartition(int grpId)Forces the index partition for the given group ID to be skipped in collected map.@Nullable PagesAllocationRangeget(FullPageId fullPageId)@Nullable PagesAllocationRangeget(GroupPartitionId key)Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.booleanisEmpty()Set<GroupPartitionId>keySet()@Nullable GroupPartitionIdnextKey(@NotNull GroupPartitionId key)Returns next (higher) key for provided cache and partition or nullvoidprepareForSnapshot()Prepare map for snapshot.PagesAllocationRangeput(GroupPartitionId key, PagesAllocationRange val)intsize()StringtoString()Iterable<PagesAllocationRange>values()
-
-
-
Method Detail
-
get
@Nullable public @Nullable PagesAllocationRange get(GroupPartitionId key)
Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.- Parameters:
key- to get- Returns:
- value or null
-
get
@Nullable public @Nullable PagesAllocationRange get(FullPageId fullPageId)
- Parameters:
fullPageId- Full page id.
-
createCachePartId
@NotNull public static @NotNull GroupPartitionId createCachePartId(@NotNull @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:
trueif skipped partition was added to the ignore list during this call.
-
nextKey
@Nullable public @Nullable GroupPartitionId nextKey(@NotNull @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 associatedval- 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.
-
-