@InterfaceAudience.Private public class TimeRangeTracker extends Object implements org.apache.hadoop.io.Writable
TimeRange
at read time instead of this. See toTimeRange() to make TimeRange to use.
MemStores use this class to track minimum and maximum timestamps. The TimeRangeTracker made by
the MemStore is passed to the StoreFile for it to write out as part a flush in the the file
metadata. If no memstore involved -- i.e. a compaction -- then the StoreFile will calculate its
own TimeRangeTracker as it appends. The StoreFile serialized TimeRangeTracker is used
at read time via an instance of TimeRange
to test if Cells fit the StoreFile TimeRange.Constructor and Description |
---|
TimeRangeTracker()
Default constructor.
|
TimeRangeTracker(long minimumTimestamp,
long maximumTimestamp) |
TimeRangeTracker(TimeRangeTracker trt)
Copy Constructor
|
Modifier and Type | Method and Description |
---|---|
long |
getMax() |
long |
getMin() |
static TimeRangeTracker |
getTimeRangeTracker(byte[] timeRangeTrackerBytes) |
boolean |
includesTimeRange(TimeRange tr)
Check if the range has ANY overlap with TimeRange
|
void |
includeTimestamp(Cell cell)
Update the current TimestampRange to include the timestamp from
cell . |
void |
readFields(DataInput in) |
String |
toString() |
void |
write(DataOutput out) |
public TimeRangeTracker()
public TimeRangeTracker(TimeRangeTracker trt)
trt
- source TimeRangeTrackerpublic TimeRangeTracker(long minimumTimestamp, long maximumTimestamp)
public void includeTimestamp(Cell cell)
cell
.
If the Key is of type DeleteColumn or DeleteFamily, it includes the
entire time range from 0 to timestamp of the key.cell
- the Cell to includepublic boolean includesTimeRange(TimeRange tr)
tr
- TimeRange, it expects [minStamp, maxStamp)public long getMin()
public long getMax()
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public static TimeRangeTracker getTimeRangeTracker(byte[] timeRangeTrackerBytes) throws IOException
timeRangeTrackerBytes
.IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.