org.apache.hadoop.hbase.regionserver
Class TimeRangeTracker

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.TimeRangeTracker
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class TimeRangeTracker
extends Object
implements org.apache.hadoop.io.Writable

Stores the minimum and maximum timestamp values. Can be used to find if any given time range overlaps with its time range MemStores use this class to track its minimum and maximum timestamps. When writing StoreFiles, this information is stored in meta blocks and used at read time to match against the required TimeRange


Constructor Summary
TimeRangeTracker()
          Default constructor.
TimeRangeTracker(long minimumTimestamp, long maximumTimestamp)
           
TimeRangeTracker(TimeRangeTracker trt)
          Copy Constructor
 
Method Summary
 long getMaximumTimestamp()
           
 long getMinimumTimestamp()
           
 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)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeRangeTracker

public TimeRangeTracker()
Default constructor. Initializes TimeRange to be null


TimeRangeTracker

public TimeRangeTracker(TimeRangeTracker trt)
Copy Constructor

Parameters:
trt - source TimeRangeTracker

TimeRangeTracker

public TimeRangeTracker(long minimumTimestamp,
                        long maximumTimestamp)
Method Detail

includeTimestamp

public 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.

Parameters:
kv - the KeyValue to include

includeTimestamp

public void includeTimestamp(byte[] key)
Update the current TimestampRange to include the timestamp from Key. If the Key is of type DeleteColumn or DeleteFamily, it includes the entire time range from 0 to timestamp of the key.

Parameters:
key -

includesTimeRange

public boolean includesTimeRange(TimeRange tr)
Check if the range has any overlap with TimeRange

Parameters:
tr - TimeRange
Returns:
True if there is overlap, false otherwise

getMinimumTimestamp

public long getMinimumTimestamp()
Returns:
the minimumTimestamp

getMaximumTimestamp

public long getMaximumTimestamp()
Returns:
the maximumTimestamp

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.