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
Nested ClassesModifier and TypeClassDescriptionprivate final classprivate static classprivate final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Comparator<? super Cell>private booleanprivate static final org.slf4j.Loggerprotected intprotected int -
Constructor Summary
ConstructorsConstructorDescriptionCellFlatMap(Comparator<? super Cell> comparator, int min, int max, boolean d) -
Method Summary
Modifier and TypeMethodDescriptionceilingEntry(Cell k) ceilingKey(Cell k) voidclear()Comparator<? super Cell>booleanbooleanprotected abstract CellFlatMapcreateSubCellFlatMap(int min, int max, boolean descending) entrySet()private intBinary search for a given key in between given boundaries of the array.firstKey()floorEntry(Cell k) protected abstract CellgetCell(int i) private intgetValidIndex(Cell key, boolean inclusive, boolean tail) Get the index of the given anchor key for creating subsequent set.higherEntry(Cell k) booleanisEmpty()keySet()lastKey()lowerEntry(Cell k) voidintsize()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
comparatorin interfaceSortedMap<Cell,Cell>
-
size
-
isEmpty
-
subMap
public NavigableMap<Cell,Cell> subMap(Cell fromKey, boolean fromInclusive, Cell toKey, boolean toInclusive) - Specified by:
subMapin interfaceNavigableMap<Cell,Cell>
-
headMap
- Specified by:
headMapin interfaceNavigableMap<Cell,Cell>
-
tailMap
- Specified by:
tailMapin interfaceNavigableMap<Cell,Cell>
-
descendingMap
- Specified by:
descendingMapin interfaceNavigableMap<Cell,Cell>
-
subMap
-
headMap
-
tailMap
-
firstKey
-
lastKey
-
lowerKey
- Specified by:
lowerKeyin interfaceNavigableMap<Cell,Cell>
-
floorKey
- Specified by:
floorKeyin interfaceNavigableMap<Cell,Cell>
-
ceilingKey
- Specified by:
ceilingKeyin interfaceNavigableMap<Cell,Cell>
-
higherKey
- Specified by:
higherKeyin interfaceNavigableMap<Cell,Cell>
-
containsKey
- Specified by:
containsKeyin interfaceMap<Cell,Cell>
-
containsValue
- Specified by:
containsValuein interfaceMap<Cell,Cell>
-
get
-
lowerEntry
- Specified by:
lowerEntryin interfaceNavigableMap<Cell,Cell>
-
higherEntry
- Specified by:
higherEntryin interfaceNavigableMap<Cell,Cell>
-
ceilingEntry
- Specified by:
ceilingEntryin interfaceNavigableMap<Cell,Cell>
-
floorEntry
- Specified by:
floorEntryin interfaceNavigableMap<Cell,Cell>
-
firstEntry
- Specified by:
firstEntryin interfaceNavigableMap<Cell,Cell>
-
lastEntry
- Specified by:
lastEntryin interfaceNavigableMap<Cell,Cell>
-
pollFirstEntry
- Specified by:
pollFirstEntryin interfaceNavigableMap<Cell,Cell>
-
pollLastEntry
- Specified by:
pollLastEntryin interfaceNavigableMap<Cell,Cell>
-
put
-
clear
-
remove
-
putAll
-
descendingKeySet
- Specified by:
descendingKeySetin interfaceNavigableMap<Cell,Cell>
-
keySet
-
values
-
entrySet
-