@InterfaceAudience.Private public abstract class Segment extends Object
| Modifier and Type | Field and Description |
|---|---|
protected AtomicLong |
dataSize |
static long |
DEEP_OVERHEAD |
static long |
FIXED_OVERHEAD |
protected AtomicLong |
heapSize |
protected long |
minSequenceId |
protected boolean |
tagsPresent |
protected TimeRangeTracker |
timeRangeTracker |
| Modifier | Constructor and Description |
|---|---|
protected |
Segment(CellComparator comparator) |
protected |
Segment(CellSet cellSet,
CellComparator comparator,
MemStoreLAB memStoreLAB) |
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
|
Cell |
getFirstAfter(Cell cell) |
long |
getMinSequenceId() |
abstract long |
getMinTimestamp() |
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
|
List<KeyValueScanner> |
getScanners(long readPoint,
long order) |
TimeRangeTracker |
getTimeRangeTracker() |
SortedSet<Cell> |
headSet(Cell firstKeyOnRow) |
long |
heapSize() |
protected long |
heapSizeChange(Cell cell,
boolean succ) |
void |
incScannerCount() |
protected void |
incSize(long delta,
long heapOverhead)
Updates the size counters of the segment by the given delta
|
protected void |
internalAdd(Cell cell,
boolean mslabUsed,
MemstoreSize memstoreSize) |
boolean |
isEmpty() |
boolean |
isTagsPresent() |
Iterator<Cell> |
iterator() |
long |
keySize() |
Cell |
last() |
Cell |
maybeCloneWithAllocator(Cell cell)
If the segment has a memory allocator the cell is being cloned to this space, and returned;
otherwise the given cell is returned
|
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
|
abstract boolean |
shouldSeek(TimeRange tr,
long oldestUnexpiredTS) |
protected SortedSet<Cell> |
tailSet(Cell firstCell)
Returns a subset of the segment cell set, which starts with the given cell
|
String |
toString() |
protected void |
updateMetaInfo(Cell cellToAdd,
boolean succ,
boolean mslabUsed,
MemstoreSize memstoreSize) |
public static final long FIXED_OVERHEAD
public static final long DEEP_OVERHEAD
protected long minSequenceId
protected final AtomicLong dataSize
protected final AtomicLong heapSize
protected final TimeRangeTracker timeRangeTracker
protected volatile boolean tagsPresent
protected Segment(CellComparator comparator)
protected Segment(CellSet cellSet, CellComparator comparator, MemStoreLAB memStoreLAB)
protected Segment(Segment segment)
protected KeyValueScanner getScanner(long readPoint)
public KeyValueScanner getScanner(long readPoint, long order)
public List<KeyValueScanner> getScanners(long readPoint, long order)
public boolean isEmpty()
public int getCellsCount()
public Cell getFirstAfter(Cell cell)
public void close()
public Cell maybeCloneWithAllocator(Cell cell)
public abstract boolean shouldSeek(TimeRange tr, long oldestUnexpiredTS)
public abstract long getMinTimestamp()
public boolean isTagsPresent()
public void incScannerCount()
public void decScannerCount()
protected Segment setCellSet(CellSet cellSetOld, CellSet cellSetNew)
public long keySize()
public long heapSize()
protected void incSize(long delta,
long heapOverhead)
public long getMinSequenceId()
public TimeRangeTracker getTimeRangeTracker()
public Cell last()
protected CellSet getCellSet()
protected CellComparator getComparator()
protected void internalAdd(Cell cell, boolean mslabUsed, MemstoreSize memstoreSize)
protected void updateMetaInfo(Cell cellToAdd, boolean succ, boolean mslabUsed, MemstoreSize memstoreSize)
protected long heapSizeChange(Cell cell, boolean succ)
protected SortedSet<Cell> tailSet(Cell firstCell)
firstCell - a cell in the segmentCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.