Package org.apache.hadoop.hbase.io
Class TimeRange
java.lang.Object
org.apache.hadoop.hbase.io.TimeRange
Represents an interval of version timestamps. Presumes timestamps between
 
INITIAL_MIN_TIMESTAMP and INITIAL_MAX_TIMESTAMP only. Gets freaked out if
 passed a timestamp that is < INITIAL_MIN_TIMESTAMP,
 Evaluated according to minStamp <= timestamp < maxStamp or [minStamp,maxStamp) in interval notation.
Can be returned and read by clients. Should not be directly created by clients. Thus, all constructors are purposely @InterfaceAudience.Private.
Immutable. Thread-safe.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final TimeRangeprivate final booleanstatic final longstatic final longprivate final longprivate final long
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0.TimeRange(byte[] minStamp) Deprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0.TimeRange(byte[] minStamp, byte[] maxStamp) Deprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0.TimeRange(long minStamp) Deprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0.TimeRange(long minStamp, long maxStamp) Deprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0.
- 
Method SummaryModifier and TypeMethodDescriptionstatic TimeRangeallTime()static TimeRangeat(long ts) static TimeRangebetween(long minStamp, long maxStamp) Represents the time interval [minStamp, maxStamp)private static voidcheck(long minStamp, long maxStamp) intcompare(long timestamp) Compare the timestamp to timerange.static TimeRangefrom(long minStamp) Represents the time interval [minStamp, Long.MAX_VALUE)longgetMax()Returns the biggest timestamp that should be consideredlonggetMin()Returns the smallest timestamp that should be consideredbooleanCheck if the range has any overlap with TimeRangebooleanCheck if it is for all timeprivate static booleanisAllTime(long minStamp, long maxStamp) toString()static TimeRangeuntil(long maxStamp) Represents the time interval [0, maxStamp)booleanwithinOrAfterTimeRange(long timestamp) Check if the specified timestamp is within or after this TimeRange.booleanwithinTimeRange(byte[] bytes, int offset) Deprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0.booleanwithinTimeRange(long timestamp) Check if the specified timestamp is within this TimeRange.
- 
Field Details- 
INITIAL_MIN_TIMESTAMP- See Also:
 
- 
INITIAL_MAX_TIMESTAMP- See Also:
 
- 
ALL_TIME
- 
minStamp
- 
maxStamp
- 
allTime
 
- 
- 
Constructor Details- 
TimeRangeDeprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0.Default constructor. Represents interval [0, Long.MAX_VALUE) (allTime)
- 
TimeRangeDeprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0.Represents interval [minStamp, Long.MAX_VALUE)- Parameters:
- minStamp- the minimum timestamp value, inclusive
 
- 
TimeRangeDeprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0.Represents interval [minStamp, Long.MAX_VALUE)- Parameters:
- minStamp- the minimum timestamp value, inclusive
 
- 
TimeRangeDeprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0.Represents interval [minStamp, maxStamp)- Parameters:
- minStamp- the minimum timestamp, inclusive
- maxStamp- the maximum timestamp, exclusive
 
- 
TimeRangeDeprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0.Represents interval [minStamp, maxStamp)- Parameters:
- minStamp- the minimum timestamp, inclusive
- maxStamp- the maximum timestamp, exclusive
- Throws:
- IllegalArgumentException- if either <0,
 
 
- 
- 
Method Details- 
allTime
- 
at
- 
fromRepresents the time interval [minStamp, Long.MAX_VALUE)- Parameters:
- minStamp- the minimum timestamp value, inclusive
 
- 
untilRepresents the time interval [0, maxStamp)- Parameters:
- maxStamp- the minimum timestamp value, exclusive
 
- 
betweenRepresents the time interval [minStamp, maxStamp)- Parameters:
- minStamp- the minimum timestamp, inclusive
- maxStamp- the maximum timestamp, exclusive
 
- 
isAllTime
- 
check
- 
getMinReturns the smallest timestamp that should be considered
- 
getMaxReturns the biggest timestamp that should be considered
- 
isAllTimeCheck if it is for all time- Returns:
- true if it is for all time
 
- 
withinTimeRangeDeprecated.This is made @InterfaceAudience.Private in the 2.0 line and above and may be changed to private or removed in 3.0. UsewithinTimeRange(long)insteadCheck if the specified timestamp is within this TimeRange.Returns true if within interval [minStamp, maxStamp), false if not. - Parameters:
- bytes- timestamp to check
- offset- offset into the bytes
- Returns:
- true if within TimeRange, false if not
 
- 
withinTimeRangeCheck if the specified timestamp is within this TimeRange.Returns true if within interval [minStamp, maxStamp), false if not. - Parameters:
- timestamp- timestamp to check
- Returns:
- true if within TimeRange, false if not
 
- 
includesTimeRangeCheck if the range has any overlap with TimeRange- Parameters:
- tr- TimeRange
- Returns:
- True if there is overlap, false otherwise
 
- 
withinOrAfterTimeRangeCheck if the specified timestamp is within or after this TimeRange.Returns true if greater than minStamp, false if not. - Parameters:
- timestamp- timestamp to check
- Returns:
- true if within or after TimeRange, false if not
 
- 
compareCompare the timestamp to timerange.- Returns:
- -1 if timestamp is less than timerange, 0 if timestamp is within timerange, 1 if timestamp is greater than timerange
 
- 
toString
 
-