Class CellFlatMap<T extends Cell>
java.lang.Object
org.apache.hadoop.hbase.regionserver.CellFlatMap<T>
- All Implemented Interfaces:
Map<T,,T> NavigableMap<T,,T> SortedMap<T,T>
- Direct Known Subclasses:
CellArrayMap,CellChunkMap
@Private
public abstract class CellFlatMap<T extends Cell>
extends Object
implements NavigableMap<T,T>
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 T>private booleanprotected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionceilingEntry(T k) ceilingKey(T k) voidclear()Comparator<? super T>booleanbooleanprotected abstract CellFlatMap<T>createSubCellFlatMap(int min, int max, boolean descending) entrySet()private intBinary search for a given key in between given boundaries of the array.firstKey()floorEntry(T k) protected abstract TgetCell(int i) private intgetValidIndex(T key, boolean inclusive, boolean tail) Get the index of the given anchor key for creating subsequent set.higherEntry(T k) booleanisEmpty()keySet()lastKey()lowerEntry(T 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
-
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
-
size
-
isEmpty
-
subMap
-
headMap
-
tailMap
-
descendingMap
- Specified by:
descendingMapin interfaceNavigableMap<T extends Cell,T extends Cell>
-
subMap
-
headMap
-
tailMap
-
firstKey
-
lastKey
-
lowerKey
-
floorKey
-
ceilingKey
- Specified by:
ceilingKeyin interfaceNavigableMap<T extends Cell,T extends Cell>
-
higherKey
-
containsKey
-
containsValue
-
get
-
lowerEntry
- Specified by:
lowerEntryin interfaceNavigableMap<T extends Cell,T extends Cell>
-
higherEntry
- Specified by:
higherEntryin interfaceNavigableMap<T extends Cell,T extends Cell>
-
ceilingEntry
- Specified by:
ceilingEntryin interfaceNavigableMap<T extends Cell,T extends Cell>
-
floorEntry
- Specified by:
floorEntryin interfaceNavigableMap<T extends Cell,T extends Cell>
-
firstEntry
- Specified by:
firstEntryin interfaceNavigableMap<T extends Cell,T extends Cell>
-
lastEntry
-
pollFirstEntry
- Specified by:
pollFirstEntryin interfaceNavigableMap<T extends Cell,T extends Cell>
-
pollLastEntry
- Specified by:
pollLastEntryin interfaceNavigableMap<T extends Cell,T extends Cell>
-
put
-
clear
-
remove
-
putAll
-
descendingKeySet
- Specified by:
descendingKeySetin interfaceNavigableMap<T extends Cell,T extends Cell>
-
keySet
-
values
-
entrySet
-