@InterfaceAudience.Private public class MemStoreSnapshot extends Object
MemStoreSnapshot is a Context Object to hold details of the snapshot taken on a MemStore.
Details include the snapshot's identifier, count of cells in it and total memory size occupied by
all the cells, timestamp information of all the cells and the snapshot immutableSegment.
NOTE:Every time when getScanners() is called, we create new
SnapshotSegmentScanners on the snapshotImmutableSegment,and
Segment.incScannerCount() is invoked in the SnapshotSegmentScanner ctor to increase
the reference count of MemStoreLAB which used by
snapshotImmutableSegment, so after we finish using these scanners, we
must call their close method to invoke Segment.decScannerCount().
| Modifier and Type | Field and Description |
|---|---|
private int |
cellsCount |
private long |
id |
private MemStoreSize |
memStoreSize |
private ImmutableSegment |
snapshotImmutableSegment |
private boolean |
tagsPresent |
private TimeRangeTracker |
timeRangeTracker |
| Constructor and Description |
|---|
MemStoreSnapshot(long id,
ImmutableSegment snapshot) |
| Modifier and Type | Method and Description |
|---|---|
int |
getCellsCount()
Returns Number of Cells in this snapshot.
|
long |
getDataSize() |
long |
getId()
Returns snapshot's identifier.
|
MemStoreSize |
getMemStoreSize() |
List<KeyValueScanner> |
getScanners()
Create new
SnapshotSegmentScanners for iterating over the snapshot. |
TimeRangeTracker |
getTimeRangeTracker()
Returns
TimeRangeTracker for all the Cells in the snapshot. |
boolean |
isTagsPresent()
Returns true if tags are present in this snapshot
|
private final long id
private final int cellsCount
private final MemStoreSize memStoreSize
private final TimeRangeTracker timeRangeTracker
private final boolean tagsPresent
private final ImmutableSegment snapshotImmutableSegment
public MemStoreSnapshot(long id, ImmutableSegment snapshot)
public long getId()
public int getCellsCount()
public long getDataSize()
public MemStoreSize getMemStoreSize()
public TimeRangeTracker getTimeRangeTracker()
TimeRangeTracker for all the Cells in the snapshot.public List<KeyValueScanner> getScanners()
SnapshotSegmentScanners for iterating over the snapshot. SnapshotSegmentScanners, Segment.incScannerCount() is
invoked in the SnapshotSegmentScanner ctor,so after we use these
SnapshotSegmentScanners, we must call SnapshotSegmentScanner.close() to invoke
Segment.decScannerCount().KeyValueScanners(Which type is SnapshotSegmentScanner) for iterating
over the snapshot.public boolean isTagsPresent()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.