Class CellFlatMap
java.lang.Object
org.apache.hadoop.hbase.regionserver.CellFlatMap
- Direct Known Subclasses:
CellArrayMap
,CellChunkMap
CellFlatMap stores a constant number of elements and is immutable after creation stage. Being
immutable, the CellFlatMap can be implemented as array. The actual array can be on- or off-heap
and is implemented in concrete class derived from CellFlatMap. The CellFlatMap uses no
synchronization primitives, it is assumed to be created by a single thread and then it can be
read-only by multiple threads. The "flat" in the name, means that the memory layout of the Map is
sequential array and thus requires less memory than ConcurrentSkipListMap.
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate final class
private static class
private final class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Comparator<? super Cell>
private boolean
private static final org.slf4j.Logger
protected int
protected int
-
Constructor Summary
ConstructorDescriptionCellFlatMap
(Comparator<? super Cell> comparator, int min, int max, boolean d) -
Method Summary
Modifier and TypeMethodDescriptionceilingEntry
(Cell k) ceilingKey
(Cell k) void
clear()
Comparator<? super Cell>
boolean
boolean
protected abstract CellFlatMap
createSubCellFlatMap
(int min, int max, boolean descending) entrySet()
private int
Binary search for a given key in between given boundaries of the array.firstKey()
floorEntry
(Cell k) protected abstract Cell
getCell
(int i) private int
getValidIndex
(Cell key, boolean inclusive, boolean tail) Get the index of the given anchor key for creating subsequent set.higherEntry
(Cell k) boolean
isEmpty()
keySet()
lastKey()
lowerEntry
(Cell k) void
int
size()
values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
LOG
-
comparator
-
minCellIdx
-
maxCellIdx
-
descending
-
-
Constructor Details
-
CellFlatMap
-
-
Method Details
-
createSubCellFlatMap
-
getCell
-
find
Binary search for a given key in between given boundaries of the array. Positive returned numbers mean the index. Negative returned numbers means the key not found. The absolute value of the output is the possible insert index for the searched key In twos-complement, (-1 * insertion point)-1 is the bitwise not of the insert point.- Parameters:
needle
- The key to look for in all of the entries- Returns:
- Same return value as Arrays.binarySearch.
-
getValidIndex
Get the index of the given anchor key for creating subsequent set. It doesn't matter whether the given key exists in the set or not. taking into consideration whether the key should be inclusive or exclusive. -
comparator
- Specified by:
comparator
in interfaceSortedMap<Cell,
Cell>
-
size
-
isEmpty
-
subMap
public NavigableMap<Cell,Cell> subMap(Cell fromKey, boolean fromInclusive, Cell toKey, boolean toInclusive) - Specified by:
subMap
in interfaceNavigableMap<Cell,
Cell>
-
headMap
- Specified by:
headMap
in interfaceNavigableMap<Cell,
Cell>
-
tailMap
- Specified by:
tailMap
in interfaceNavigableMap<Cell,
Cell>
-
descendingMap
- Specified by:
descendingMap
in interfaceNavigableMap<Cell,
Cell>
-
subMap
-
headMap
-
tailMap
-
firstKey
-
lastKey
-
lowerKey
- Specified by:
lowerKey
in interfaceNavigableMap<Cell,
Cell>
-
floorKey
- Specified by:
floorKey
in interfaceNavigableMap<Cell,
Cell>
-
ceilingKey
- Specified by:
ceilingKey
in interfaceNavigableMap<Cell,
Cell>
-
higherKey
- Specified by:
higherKey
in interfaceNavigableMap<Cell,
Cell>
-
containsKey
- Specified by:
containsKey
in interfaceMap<Cell,
Cell>
-
containsValue
- Specified by:
containsValue
in interfaceMap<Cell,
Cell>
-
get
-
lowerEntry
- Specified by:
lowerEntry
in interfaceNavigableMap<Cell,
Cell>
-
higherEntry
- Specified by:
higherEntry
in interfaceNavigableMap<Cell,
Cell>
-
ceilingEntry
- Specified by:
ceilingEntry
in interfaceNavigableMap<Cell,
Cell>
-
floorEntry
- Specified by:
floorEntry
in interfaceNavigableMap<Cell,
Cell>
-
firstEntry
- Specified by:
firstEntry
in interfaceNavigableMap<Cell,
Cell>
-
lastEntry
- Specified by:
lastEntry
in interfaceNavigableMap<Cell,
Cell>
-
pollFirstEntry
- Specified by:
pollFirstEntry
in interfaceNavigableMap<Cell,
Cell>
-
pollLastEntry
- Specified by:
pollLastEntry
in interfaceNavigableMap<Cell,
Cell>
-
put
-
clear
-
remove
-
putAll
-
descendingKeySet
- Specified by:
descendingKeySet
in interfaceNavigableMap<Cell,
Cell>
-
keySet
-
values
-
entrySet
-