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
Modifier and TypeClassDescriptionprivate final class
private static class
private final class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Comparator<? super T>
private boolean
protected int
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionceilingEntry
(T k) ceilingKey
(T k) void
clear()
Comparator<? super T>
boolean
boolean
protected abstract CellFlatMap<T>
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
(T k) protected abstract T
getCell
(int i) private int
getValidIndex
(T key, boolean inclusive, boolean tail) Get the index of the given anchor key for creating subsequent set.higherEntry
(T k) boolean
isEmpty()
keySet()
lastKey()
lowerEntry
(T 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
-
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:
descendingMap
in interfaceNavigableMap<T extends Cell,
T extends Cell>
-
subMap
-
headMap
-
tailMap
-
firstKey
-
lastKey
-
lowerKey
-
floorKey
-
ceilingKey
- Specified by:
ceilingKey
in interfaceNavigableMap<T extends Cell,
T extends Cell>
-
higherKey
-
containsKey
-
containsValue
-
get
-
lowerEntry
- Specified by:
lowerEntry
in interfaceNavigableMap<T extends Cell,
T extends Cell>
-
higherEntry
- Specified by:
higherEntry
in interfaceNavigableMap<T extends Cell,
T extends Cell>
-
ceilingEntry
- Specified by:
ceilingEntry
in interfaceNavigableMap<T extends Cell,
T extends Cell>
-
floorEntry
- Specified by:
floorEntry
in interfaceNavigableMap<T extends Cell,
T extends Cell>
-
firstEntry
- Specified by:
firstEntry
in interfaceNavigableMap<T extends Cell,
T extends Cell>
-
lastEntry
-
pollFirstEntry
- Specified by:
pollFirstEntry
in interfaceNavigableMap<T extends Cell,
T extends Cell>
-
pollLastEntry
- Specified by:
pollLastEntry
in interfaceNavigableMap<T extends Cell,
T extends Cell>
-
put
-
clear
-
remove
-
putAll
-
descendingKeySet
- Specified by:
descendingKeySet
in interfaceNavigableMap<T extends Cell,
T extends Cell>
-
keySet
-
values
-
entrySet
-