Class CellChunkMap<T extends Cell>
java.lang.Object
org.apache.hadoop.hbase.regionserver.CellFlatMap<T>
org.apache.hadoop.hbase.regionserver.CellChunkMap<T>
- All Implemented Interfaces:
Map<T,
,T> NavigableMap<T,
,T> SortedMap<T,
T>
CellChunkMap is an array of serialized representations of Cell (pointing to Chunks with full Cell
data) and can be allocated both off-heap and on-heap.
CellChunkMap is a byte array (chunk) holding all that is needed to access a Cell, which is actually saved on another deeper chunk. Per Cell we have a reference to this deeper byte array B (chunk ID, integer), offset in bytes in B (integer), length in bytes in B (integer) and seqID of the cell (long). In order to save reference to byte array we use the Chunk's ID given by ChunkCreator.
The CellChunkMap memory layout on chunk A relevant to a deeper byte array B, holding the actual cell data:
< header > <--------------- first Cell -----------------> <-- second Cell ... --------------------------------------------------------------------------------------- ... integer | integer | integer | integer | long | 4 bytes | 4 bytes | 4 bytes | 4 bytes | 8 bytes | ChunkID | chunkID of | offset in B | length of | sequence | ... of this | chunk B with | where Cell's | Cell's | ID of | chunk A | Cell data | data starts | data in B | the Cell | --------------------------------------------------------------------------------------- ...
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.regionserver.CellFlatMap
maxCellIdx, minCellIdx
-
Constructor Summary
ConstructorDescriptionCellChunkMap
(Comparator<? super T> comparator, Chunk[] chunks, int min, int max, boolean descending) C-tor for creating CellChunkMap from existing Chunk array, which must be ordered (decreasingly or increasingly according to parameter "descending") -
Method Summary
Modifier and TypeMethodDescriptionprotected CellFlatMap<T>
createSubCellFlatMap
(int min, int max, boolean descending) To be used by base (CellFlatMap) class only to create a sub-CellFlatMap Should be used only to create only CellChunkMap from CellChunkMapprotected T
getCell
(int i) Methods inherited from class org.apache.hadoop.hbase.regionserver.CellFlatMap
ceilingEntry, ceilingKey, clear, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, get, headMap, headMap, higherEntry, higherKey, isEmpty, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, size, subMap, subMap, tailMap, tailMap, 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
-
chunks
-
numOfCellRepsInChunk
-
-
Constructor Details
-
CellChunkMap
public CellChunkMap(Comparator<? super T> comparator, Chunk[] chunks, int min, int max, boolean descending) C-tor for creating CellChunkMap from existing Chunk array, which must be ordered (decreasingly or increasingly according to parameter "descending")- Parameters:
comparator
- a tool for comparing cellschunks
- ordered array of index chunk with cell representationsmin
- the index of the first cell (usually 0)max
- number of Cells or the index of the cell after the maximal celldescending
- the order of the given array
-
-
Method Details
-
createSubCellFlatMap
To be used by base (CellFlatMap) class only to create a sub-CellFlatMap Should be used only to create only CellChunkMap from CellChunkMap- Specified by:
createSubCellFlatMap
in classCellFlatMap<T extends Cell>
-
getCell
- Specified by:
getCell
in classCellFlatMap<T extends Cell>
-