public abstract class Segment extends java.lang.Object implements MemStoreSizing
| Modifier and Type | Field and Description |
|---|---|
static long |
DEEP_OVERHEAD |
static long |
FIXED_OVERHEAD |
protected MemStoreSizing |
memStoreSizing |
protected long |
minSequenceId |
protected boolean |
tagsPresent |
protected TimeRangeTracker |
timeRangeTracker |
DUD| Modifier | Constructor and Description |
|---|---|
protected |
Segment(CellComparator comparator,
java.util.List<ImmutableSegment> segments,
TimeRangeTracker trt) |
protected |
Segment(CellComparator comparator,
TimeRangeTracker trt) |
protected |
Segment(CellSet cellSet,
CellComparator comparator,
MemStoreLAB memStoreLAB,
TimeRangeTracker trt) |
protected |
Segment(Segment segment) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closing a segment before it is being discarded
|
int |
compare(Cell left,
Cell right) |
int |
compareRows(Cell left,
Cell right) |
void |
decScannerCount() |
int |
getCellsCount() |
protected CellSet |
getCellSet() |
protected CellComparator |
getComparator()
Returns the Cell comparator used by this segment
|
long |
getDataSize() |
long |
getHeapSize() |
MemStoreSize |
getMemStoreSize() |
long |
getMinSequenceId() |
long |
getOffHeapSize() |
protected KeyValueScanner |
getScanner(long readPoint)
Creates the scanner for the given read point
|
KeyValueScanner |
getScanner(long readPoint,
long order)
Creates the scanner for the given read point, and a specific order in a list
|
java.util.List<KeyValueScanner> |
getScanners(long readPoint,
long order) |
TimeRangeTracker |
getTimeRangeTracker() |
java.util.SortedSet<Cell> |
headSet(Cell firstKeyOnRow) |
protected long |
heapSizeChange(Cell cell,
boolean succ) |
long |
incMemStoreSize(long delta,
long heapOverhead,
long offHeapOverhead) |
void |
incScannerCount() |
protected long |
indexEntryOffHeapSize(boolean offHeap) |
protected long |
indexEntryOnHeapSize(boolean onHeap) |
protected abstract long |
indexEntrySize() |
protected void |
internalAdd(Cell cell,
boolean mslabUsed,
MemStoreSizing memstoreSizing) |
boolean |
isEmpty() |
boolean |
isTagsPresent() |
java.util.Iterator<Cell> |
iterator() |
Cell |
last() |
Cell |
maybeCloneWithAllocator(Cell 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 returned
When a cell's size is too big (bigger than maxAlloc), it is not allocated on MSLAB.
|
protected long |
offHeapSizeChange(Cell cell,
boolean succ) |
protected Segment |
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 constructor
|
boolean |
shouldSeek(TimeRange tr,
long oldestUnexpiredTS) |
protected java.util.SortedSet<Cell> |
tailSet(Cell firstCell)
Returns a subset of the segment cell set, which starts with the given cell
|
java.lang.String |
toString() |
protected void |
updateMetaInfo(Cell cellToAdd,
boolean succ,
boolean mslabUsed,
MemStoreSizing memstoreSizing) |
protected void |
updateMetaInfo(Cell cellToAdd,
boolean succ,
MemStoreSizing memstoreSizing) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdecMemStoreSize, decMemStoreSize, incMemStoreSizepublic static final long FIXED_OVERHEAD
public static final long DEEP_OVERHEAD
protected long minSequenceId
protected final MemStoreSizing memStoreSizing
protected final TimeRangeTracker timeRangeTracker
protected volatile boolean tagsPresent
protected Segment(CellComparator comparator,
TimeRangeTracker trt)
protected Segment(CellComparator comparator,
java.util.List<ImmutableSegment> segments,
TimeRangeTracker trt)
protected Segment(CellSet cellSet, CellComparator comparator, MemStoreLAB memStoreLAB, TimeRangeTracker trt)
protected Segment(Segment segment)
protected KeyValueScanner getScanner(long readPoint)
public KeyValueScanner getScanner(long readPoint, long order)
public java.util.List<KeyValueScanner> getScanners(long readPoint, long order)
public boolean isEmpty()
public int getCellsCount()
public void close()
public Cell maybeCloneWithAllocator(Cell cell,
boolean forceCloneOfBigCell)
public boolean shouldSeek(TimeRange tr,
long oldestUnexpiredTS)
public boolean isTagsPresent()
public void incScannerCount()
public void decScannerCount()
protected Segment setCellSet(CellSet cellSetOld, CellSet cellSetNew)
public MemStoreSize getMemStoreSize()
getMemStoreSize in interface MemStoreSizingMemStoreSizing.getDataSize(),
MemStoreSizing.getHeapSize(), and MemStoreSizing.getOffHeapSize(), in the one go.public long getDataSize()
getDataSize in interface MemStoreSizingpublic long getHeapSize()
getHeapSize in interface MemStoreSizingpublic long getOffHeapSize()
getOffHeapSize in interface MemStoreSizingpublic long incMemStoreSize(long delta,
long heapOverhead,
long offHeapOverhead)
incMemStoreSize in interface MemStoreSizingpublic long getMinSequenceId()
public TimeRangeTracker getTimeRangeTracker()
public Cell last()
public java.util.Iterator<Cell> iterator()
public java.util.SortedSet<Cell> headSet(Cell firstKeyOnRow)
public int compare(Cell left,
Cell right)
public int compareRows(Cell left,
Cell right)
protected CellSet getCellSet()
protected CellComparator getComparator()
protected void internalAdd(Cell cell,
boolean mslabUsed,
MemStoreSizing memstoreSizing)
protected void updateMetaInfo(Cell cellToAdd,
boolean succ,
boolean mslabUsed,
MemStoreSizing memstoreSizing)
protected void updateMetaInfo(Cell cellToAdd,
boolean succ,
MemStoreSizing memstoreSizing)
protected long heapSizeChange(Cell cell,
boolean succ)
protected long offHeapSizeChange(Cell cell,
boolean succ)
protected long indexEntryOnHeapSize(boolean onHeap)
protected long indexEntryOffHeapSize(boolean offHeap)
protected abstract long indexEntrySize()
protected java.util.SortedSet<Cell> tailSet(Cell firstCell)
firstCell - a cell in the segmentpublic java.lang.String toString()
toString in class java.lang.Object