|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.regionserver.TimeRangeTracker
@InterfaceAudience.Private public class TimeRangeTracker
Stores minimum and maximum timestamp values. Both timestamps are inclusive.
Use this class at write-time ONLY. Too much synchronization to use at read time
(TODO: there are two scenarios writing, once when lots of concurrency as part of memstore
updates but then later we can make one as part of a compaction when there is only one thread
involved -- consider making different version, the synchronized and the unsynchronized).
Use 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 Summary | |
---|---|
TimeRangeTracker()
Default constructor. |
|
TimeRangeTracker(long minimumTimestamp,
long maximumTimestamp)
|
|
TimeRangeTracker(TimeRangeTracker trt)
Copy Constructor |
Method Summary | |
---|---|
long |
getMax()
|
long |
getMin()
|
static TimeRangeTracker |
getTimeRangeTracker(byte[] timeRangeTrackerBytes)
|
boolean |
includesTimeRange(TimeRange tr)
Check if the range has any overlap with TimeRange |
void |
includeTimestamp(byte[] key)
Update the current TimestampRange to include the timestamp from Key. |
void |
includeTimestamp(KeyValue kv)
Update the current TimestampRange to include the timestamp from KeyValue If the Key is of type DeleteColumn or DeleteFamily, it includes the entire time range from 0 to timestamp of the key. |
void |
readFields(DataInput in)
|
String |
toString()
|
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TimeRangeTracker()
public TimeRangeTracker(TimeRangeTracker trt)
trt
- source TimeRangeTrackerpublic TimeRangeTracker(long minimumTimestamp, long maximumTimestamp)
Method Detail |
---|
public void includeTimestamp(KeyValue kv)
kv
- the KeyValue to includepublic void includeTimestamp(byte[] key)
key
- public boolean includesTimeRange(TimeRange tr)
tr
- TimeRange
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 String toString()
toString
in class Object
public static TimeRangeTracker getTimeRangeTracker(byte[] timeRangeTrackerBytes) throws IOException
timeRangeTrackerBytes
.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |