Class CompositeImmutableSegment
java.lang.Object
org.apache.hadoop.hbase.regionserver.Segment
org.apache.hadoop.hbase.regionserver.ImmutableSegment
org.apache.hadoop.hbase.regionserver.CompositeImmutableSegment
- All Implemented Interfaces:
MemStoreSizing
The CompositeImmutableSegments is created as a collection of ImmutableSegments and supports the
interface of a single ImmutableSegments. The CompositeImmutableSegments is planned to be used
only as a snapshot, thus only relevant interfaces are supported
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.regionserver.ImmutableSegment
DEEP_OVERHEAD
Fields inherited from class org.apache.hadoop.hbase.regionserver.Segment
FIXED_OVERHEAD, memStoreSizing, minSequenceId, tagsPresent, timeRangeTracker
Fields inherited from interface org.apache.hadoop.hbase.regionserver.MemStoreSizing
DUD
-
Constructor Summary
ConstructorDescriptionCompositeImmutableSegment
(CellComparator comparator, List<ImmutableSegment> segments) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
void
close()
Closing a segment before it is being discardedint
int
compareRows
(Cell left, Cell right) void
(package private) void
dump
(org.slf4j.Logger log) Dumps all cells of the segment into the given logint
Returns number of cells in segmentprotected CellSet<ExtendedCell>
Returns a set of all cells in the segmentlong
Returns Sum of all cell sizes.long
Returns The heap size of this segment.long
int
getScanner
(long readPoint) Creates the scanner for the given read pointgetScanners
(long readPoint) (package private) List<KeyValueScanner>
We create a newSnapshotSegmentScanner
to increase the reference count ofMemStoreLABImpl
used by this segment.headSet
(ExtendedCell firstKeyOnRow) long
incMemStoreSize
(long delta, long heapOverhead, long offHeapOverhead, int cellsCount) Updates the heap size counter of the segment by the given deltavoid
protected long
protected void
internalAdd
(ExtendedCell cell, boolean mslabUsed, MemStoreSizing memstoreSizing, boolean sizeAddedPreOperation) boolean
isEmpty()
Returns whether the segment has any cellsboolean
iterator()
last()
maybeCloneWithAllocator
(ExtendedCell cell, boolean forceCloneOfBigCell) If the segment has a memory allocator the cell is being cloned to this space, and returned; otherwise the given cell is returnedprotected CompositeImmutableSegment
setCellSet
(CellSet cellSetOld, CellSet cellSetNew) Setting the CellSet of the segment - used only for flat immutable segment for setting immutable CellSet after its creation in immutable segment constructorboolean
shouldSeek
(TimeRange tr, long oldestUnexpiredTS) protected SortedSet<ExtendedCell>
tailSet
(ExtendedCell firstCell) Returns a subset of the segment cell set, which starts with the given celltoString()
protected void
updateMetaInfo
(ExtendedCell cellToAdd, boolean succ, boolean mslabUsed, MemStoreSizing memstoreSizing, boolean sizeAddedPreOperation) Methods inherited from class org.apache.hadoop.hbase.regionserver.ImmutableSegment
getNumUniqueKeys
Methods inherited from class org.apache.hadoop.hbase.regionserver.Segment
compareAndSetDataSize, getCellLength, getComparator, getMemStoreLAB, getMemStoreSize, getOffHeapSize, heapSizeChange, indexEntryOffHeapSize, indexEntryOnHeapSize, offHeapSizeChange, sharedLock, sharedUnlock, updateMetaInfo, waitForUpdates
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.regionserver.MemStoreSizing
decMemStoreSize, decMemStoreSize, incMemStoreSize
-
Field Details
-
segments
-
keySize
-
-
Constructor Details
-
CompositeImmutableSegment
-
-
Method Details
-
getAllSegments
- Overrides:
getAllSegments
in classImmutableSegment
-
getNumOfSegments
- Overrides:
getNumOfSegments
in classImmutableSegment
-
isEmpty
Returns whether the segment has any cells -
getCellsCount
Returns number of cells in segment- Specified by:
getCellsCount
in interfaceMemStoreSizing
- Overrides:
getCellsCount
in classSegment
-
close
Closing a segment before it is being discarded -
maybeCloneWithAllocator
If the segment has a memory allocator the cell is being cloned to this space, and returned; otherwise the given cell is returned- Overrides:
maybeCloneWithAllocator
in classSegment
- Returns:
- either the given cell or its clone
-
shouldSeek
- Overrides:
shouldSeek
in classSegment
-
getScanner
Creates the scanner for the given read point- Overrides:
getScanner
in classSegment
- Returns:
- a scanner for the given read point
-
getScanners
- Overrides:
getScanners
in classSegment
-
isTagsPresent
- Overrides:
isTagsPresent
in classSegment
-
incScannerCount
- Overrides:
incScannerCount
in classSegment
-
decScannerCount
- Overrides:
decScannerCount
in classSegment
-
setCellSet
Setting the CellSet of the segment - used only for flat immutable segment for setting immutable CellSet after its creation in immutable segment constructor- Overrides:
setCellSet
in classSegment
- Returns:
- this object
-
indexEntrySize
- Specified by:
indexEntrySize
in classSegment
-
canBeFlattened
- Specified by:
canBeFlattened
in classImmutableSegment
-
getDataSize
Returns Sum of all cell sizes.- Specified by:
getDataSize
in interfaceMemStoreSizing
- Overrides:
getDataSize
in classSegment
-
getHeapSize
Returns The heap size of this segment.- Specified by:
getHeapSize
in interfaceMemStoreSizing
- Overrides:
getHeapSize
in classSegment
-
incMemStoreSize
Updates the heap size counter of the segment by the given delta- Specified by:
incMemStoreSize
in interfaceMemStoreSizing
- Overrides:
incMemStoreSize
in classSegment
-
getMinSequenceId
- Overrides:
getMinSequenceId
in classSegment
-
getTimeRangeTracker
- Overrides:
getTimeRangeTracker
in classSegment
-
last
-
iterator
-
headSet
-
compare
-
compareRows
- Overrides:
compareRows
in classSegment
-
getCellSet
Returns a set of all cells in the segment- Overrides:
getCellSet
in classSegment
-
internalAdd
protected void internalAdd(ExtendedCell cell, boolean mslabUsed, MemStoreSizing memstoreSizing, boolean sizeAddedPreOperation) - Overrides:
internalAdd
in classSegment
-
updateMetaInfo
protected void updateMetaInfo(ExtendedCell cellToAdd, boolean succ, boolean mslabUsed, MemStoreSizing memstoreSizing, boolean sizeAddedPreOperation) - Overrides:
updateMetaInfo
in classSegment
-
tailSet
Returns a subset of the segment cell set, which starts with the given cell -
dump
Dumps all cells of the segment into the given log -
toString
- Overrides:
toString
in classImmutableSegment
-
getSnapshotScanners
Description copied from class:ImmutableSegment
We create a newSnapshotSegmentScanner
to increase the reference count ofMemStoreLABImpl
used by this segment.- Overrides:
getSnapshotScanners
in classImmutableSegment
-