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
FieldsFields inherited from class org.apache.hadoop.hbase.regionserver.ImmutableSegment
DEEP_OVERHEADFields inherited from class org.apache.hadoop.hbase.regionserver.Segment
FIXED_OVERHEAD, memStoreSizing, minSequenceId, tagsPresent, timeRangeTrackerFields inherited from interface org.apache.hadoop.hbase.regionserver.MemStoreSizing
DUD -
Constructor Summary
ConstructorsConstructorDescriptionCompositeImmutableSegment(CellComparator comparator, List<ImmutableSegment> segments) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanvoidclose()Closing a segment before it is being discardedintintcompareRows(Cell left, Cell right) void(package private) voiddump(org.slf4j.Logger log) Dumps all cells of the segment into the given logintReturns number of cells in segmentprotected CellSet<ExtendedCell>Returns a set of all cells in the segmentlongReturns Sum of all cell sizes.longReturns The heap size of this segment.longintgetScanner(long readPoint) Creates the scanner for the given read pointgetScanners(long readPoint) (package private) List<KeyValueScanner>We create a newSnapshotSegmentScannerto increase the reference count ofMemStoreLABImplused by this segment.headSet(ExtendedCell firstKeyOnRow) longincMemStoreSize(long delta, long heapOverhead, long offHeapOverhead, int cellsCount) Updates the heap size counter of the segment by the given deltavoidprotected longprotected voidinternalAdd(ExtendedCell cell, boolean mslabUsed, MemStoreSizing memstoreSizing, boolean sizeAddedPreOperation) booleanisEmpty()Returns whether the segment has any cellsbooleaniterator()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 CompositeImmutableSegmentsetCellSet(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 constructorbooleanshouldSeek(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 voidupdateMetaInfo(ExtendedCell cellToAdd, boolean succ, boolean mslabUsed, MemStoreSizing memstoreSizing, boolean sizeAddedPreOperation) Methods inherited from class org.apache.hadoop.hbase.regionserver.ImmutableSegment
getNumUniqueKeysMethods inherited from class org.apache.hadoop.hbase.regionserver.Segment
compareAndSetDataSize, getCellLength, getComparator, getMemStoreLAB, getMemStoreSize, getOffHeapSize, heapSizeChange, indexEntryOffHeapSize, indexEntryOnHeapSize, offHeapSizeChange, sharedLock, sharedUnlock, updateMetaInfo, waitForUpdatesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.regionserver.MemStoreSizing
decMemStoreSize, decMemStoreSize, incMemStoreSize
-
Field Details
-
segments
-
keySize
-
-
Constructor Details
-
CompositeImmutableSegment
-
-
Method Details
-
getAllSegments
- Overrides:
getAllSegmentsin classImmutableSegment
-
getNumOfSegments
- Overrides:
getNumOfSegmentsin classImmutableSegment
-
isEmpty
Returns whether the segment has any cells -
getCellsCount
Returns number of cells in segment- Specified by:
getCellsCountin interfaceMemStoreSizing- Overrides:
getCellsCountin 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:
maybeCloneWithAllocatorin classSegment- Returns:
- either the given cell or its clone
-
shouldSeek
- Overrides:
shouldSeekin classSegment
-
getScanner
Creates the scanner for the given read point- Overrides:
getScannerin classSegment- Returns:
- a scanner for the given read point
-
getScanners
- Overrides:
getScannersin classSegment
-
isTagsPresent
- Overrides:
isTagsPresentin classSegment
-
incScannerCount
- Overrides:
incScannerCountin classSegment
-
decScannerCount
- Overrides:
decScannerCountin 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:
setCellSetin classSegment- Returns:
- this object
-
indexEntrySize
- Specified by:
indexEntrySizein classSegment
-
canBeFlattened
- Specified by:
canBeFlattenedin classImmutableSegment
-
getDataSize
Returns Sum of all cell sizes.- Specified by:
getDataSizein interfaceMemStoreSizing- Overrides:
getDataSizein classSegment
-
getHeapSize
Returns The heap size of this segment.- Specified by:
getHeapSizein interfaceMemStoreSizing- Overrides:
getHeapSizein classSegment
-
incMemStoreSize
Updates the heap size counter of the segment by the given delta- Specified by:
incMemStoreSizein interfaceMemStoreSizing- Overrides:
incMemStoreSizein classSegment
-
getMinSequenceId
- Overrides:
getMinSequenceIdin classSegment
-
getTimeRangeTracker
- Overrides:
getTimeRangeTrackerin classSegment
-
last
-
iterator
-
headSet
-
compare
-
compareRows
- Overrides:
compareRowsin classSegment
-
getCellSet
Returns a set of all cells in the segment- Overrides:
getCellSetin classSegment
-
internalAdd
protected void internalAdd(ExtendedCell cell, boolean mslabUsed, MemStoreSizing memstoreSizing, boolean sizeAddedPreOperation) - Overrides:
internalAddin classSegment
-
updateMetaInfo
protected void updateMetaInfo(ExtendedCell cellToAdd, boolean succ, boolean mslabUsed, MemStoreSizing memstoreSizing, boolean sizeAddedPreOperation) - Overrides:
updateMetaInfoin 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:
toStringin classImmutableSegment
-
getSnapshotScanners
Description copied from class:ImmutableSegmentWe create a newSnapshotSegmentScannerto increase the reference count ofMemStoreLABImplused by this segment.- Overrides:
getSnapshotScannersin classImmutableSegment
-