org.apache.accumulo.core.data
public class Range extends Object implements org.apache.hadoop.io.WritableComparable<Range>
Modifier | Constructor and Description |
---|---|
|
Range()
Creates a range that goes from negative to positive infinity
|
|
Range(CharSequence row)
Creates a range that covers an entire row
|
|
Range(CharSequence startRow,
boolean startRowInclusive,
CharSequence endRow,
boolean endRowInclusive)
Creates a range from startRow to endRow
|
|
Range(CharSequence startRow,
CharSequence endRow)
Creates a range from startRow inclusive to endRow inclusive
|
protected |
Range(Key start,
boolean startKeyInclusive,
boolean infiniteStartKey,
Key stop,
boolean stopKeyInclusive,
boolean infiniteStopKey)
Creates a range from start to stop.
|
|
Range(Key startKey,
boolean startKeyInclusive,
Key endKey,
boolean endKeyInclusive)
Creates a range from startKey to endKey
|
|
Range(Key startKey,
Key endKey)
Creates a range from startKey inclusive to endKey inclusive
|
|
Range(Key start,
Key stop,
boolean startKeyInclusive,
boolean stopKeyInclusive,
boolean infiniteStartKey,
boolean infiniteStopKey)
Creates a range from start to stop.
|
|
Range(Range range)
Copies a range
|
|
Range(org.apache.hadoop.io.Text row)
Creates a range that covers an entire row
|
|
Range(org.apache.hadoop.io.Text startRow,
boolean startRowInclusive,
org.apache.hadoop.io.Text endRow,
boolean endRowInclusive)
Creates a range from startRow to endRow
|
|
Range(org.apache.hadoop.io.Text startRow,
org.apache.hadoop.io.Text endRow)
Creates a range from startRow inclusive to endRow inclusive
|
|
Range(TRange trange) |
Modifier and Type | Method and Description |
---|---|
boolean |
afterEndKey(Key key) |
boolean |
beforeStartKey(Key key) |
Range |
bound(Column min,
Column max)
Creates a new range that is bounded by the columns passed in.
|
Range |
clip(Range range)
Creates a range which represents the intersection of this range and the passed in range.
|
Range |
clip(Range range,
boolean returnNullIfDisjoint)
Same as other clip function except if gives the option to return null of the ranges do not overlap instead of throwing an exception.
|
int |
compareTo(Range o)
Compares this range to another range.
|
boolean |
contains(Key key) |
boolean |
equals(Object o) |
boolean |
equals(Range otherRange) |
static Range |
exact(CharSequence row)
Creates a range that covers an exact row
|
static Range |
exact(CharSequence row,
CharSequence cf)
Creates a range that covers an exact row and column family
|
static Range |
exact(CharSequence row,
CharSequence cf,
CharSequence cq)
Creates a range that covers an exact row, column family, and column qualifier
|
static Range |
exact(CharSequence row,
CharSequence cf,
CharSequence cq,
CharSequence cv)
Creates a range that covers an exact row, column family, column qualifier, and visibility
|
static Range |
exact(CharSequence row,
CharSequence cf,
CharSequence cq,
CharSequence cv,
long ts)
Creates a range that covers an exact row, column family, column qualifier, visibility, and timestamp
|
static Range |
exact(org.apache.hadoop.io.Text row)
Creates a range that covers an exact row Returns the same Range as new Range(row)
|
static Range |
exact(org.apache.hadoop.io.Text row,
org.apache.hadoop.io.Text cf)
Creates a range that covers an exact row and column family
|
static Range |
exact(org.apache.hadoop.io.Text row,
org.apache.hadoop.io.Text cf,
org.apache.hadoop.io.Text cq)
Creates a range that covers an exact row, column family, and column qualifier
|
static Range |
exact(org.apache.hadoop.io.Text row,
org.apache.hadoop.io.Text cf,
org.apache.hadoop.io.Text cq,
org.apache.hadoop.io.Text cv)
Creates a range that covers an exact row, column family, column qualifier, and visibility
|
static Range |
exact(org.apache.hadoop.io.Text row,
org.apache.hadoop.io.Text cf,
org.apache.hadoop.io.Text cq,
org.apache.hadoop.io.Text cv,
long ts)
Creates a range that covers an exact row, column family, column qualifier, visibility, and timestamp
|
static org.apache.hadoop.io.Text |
followingPrefix(org.apache.hadoop.io.Text prefix)
Returns a Text that sorts just after all Texts beginning with a prefix
|
Key |
getEndKey() |
Key |
getStartKey() |
int |
hashCode() |
boolean |
isEndKeyInclusive() |
boolean |
isInfiniteStartKey() |
boolean |
isInfiniteStopKey() |
boolean |
isStartKeyInclusive() |
static List<Range> |
mergeOverlapping(Collection<Range> ranges)
Takes a collection on range and merges overlapping and adjacent ranges.
|
static Range |
prefix(CharSequence rowPrefix)
Returns a Range that covers all rows beginning with a prefix
|
static Range |
prefix(CharSequence row,
CharSequence cfPrefix)
Returns a Range that covers all column families beginning with a prefix within a given row
|
static Range |
prefix(CharSequence row,
CharSequence cf,
CharSequence cqPrefix)
Returns a Range that covers all column qualifiers beginning with a prefix within a given row and column family
|
static Range |
prefix(CharSequence row,
CharSequence cf,
CharSequence cq,
CharSequence cvPrefix)
Returns a Range that covers all column visibilities beginning with a prefix within a given row, column family, and column qualifier
|
static Range |
prefix(org.apache.hadoop.io.Text rowPrefix)
Returns a Range that covers all rows beginning with a prefix
|
static Range |
prefix(org.apache.hadoop.io.Text row,
org.apache.hadoop.io.Text cfPrefix)
Returns a Range that covers all column families beginning with a prefix within a given row
|
static Range |
prefix(org.apache.hadoop.io.Text row,
org.apache.hadoop.io.Text cf,
org.apache.hadoop.io.Text cqPrefix)
Returns a Range that covers all column qualifiers beginning with a prefix within a given row and column family
|
static Range |
prefix(org.apache.hadoop.io.Text row,
org.apache.hadoop.io.Text cf,
org.apache.hadoop.io.Text cq,
org.apache.hadoop.io.Text cvPrefix)
Returns a Range that covers all column visibilities beginning with a prefix within a given row, column family, and column qualifier
|
void |
readFields(DataInput in) |
String |
toString() |
TRange |
toThrift() |
void |
write(DataOutput out) |
public Range()
public Range(Key startKey, Key endKey)
startKey
- set this to null when negative infinity is neededendKey
- set this to null when positive infinity is neededpublic Range(CharSequence row)
row
- set this to null to cover all rowspublic Range(org.apache.hadoop.io.Text row)
row
- set this to null to cover all rowspublic Range(org.apache.hadoop.io.Text startRow, org.apache.hadoop.io.Text endRow)
startRow
- set this to null when negative infinity is neededendRow
- set this to null when positive infinity is neededpublic Range(CharSequence startRow, CharSequence endRow)
startRow
- set this to null when negative infinity is neededendRow
- set this to null when positive infinity is neededpublic Range(org.apache.hadoop.io.Text startRow, boolean startRowInclusive, org.apache.hadoop.io.Text endRow, boolean endRowInclusive)
startRow
- set this to null when negative infinity is neededstartRowInclusive
- determines if the start row is skippedendRow
- set this to null when positive infinity is neededendRowInclusive
- determines if the endRow is includedpublic Range(CharSequence startRow, boolean startRowInclusive, CharSequence endRow, boolean endRowInclusive)
startRow
- set this to null when negative infinity is neededstartRowInclusive
- determines if the start row is skippedendRow
- set this to null when positive infinity is neededendRowInclusive
- determines if the endRow is includedpublic Range(Key startKey, boolean startKeyInclusive, Key endKey, boolean endKeyInclusive)
startKey
- set this to null when negative infinity is neededstartKeyInclusive
- determines if the ranges includes the start keyendKey
- set this to null when infinity is neededendKeyInclusive
- determines if the range includes the end keypublic Range(Range range)
public Range(Key start, Key stop, boolean startKeyInclusive, boolean stopKeyInclusive, boolean infiniteStartKey, boolean infiniteStopKey)
start
- set this to null when negative infinity is neededstop
- set this to null when infinity is neededstartKeyInclusive
- determines if the ranges includes the start keystopKeyInclusive
- determines if the range includes the end keyinfiniteStartKey
- true if start key is negative infinity (null)infiniteStopKey
- true if stop key is positive infinity (null)IllegalArgumentException
- if stop is before start, or infiniteStartKey is true but start is not null, or infiniteStopKey is true but stop is not
nullprotected Range(Key start, boolean startKeyInclusive, boolean infiniteStartKey, Key stop, boolean stopKeyInclusive, boolean infiniteStopKey)
start
- set this to null when negative infinity is neededstartKeyInclusive
- determines if the ranges includes the start keyinfiniteStartKey
- true if start key is negative infinity (null)stop
- set this to null when infinity is neededstopKeyInclusive
- determines if the range includes the end keyinfiniteStopKey
- true if stop key is positive infinity (null)IllegalArgumentException
- if infiniteStartKey is true but start is not null, or infiniteStopKey is true but stop is not nullpublic Range(TRange trange)
public Key getStartKey()
public boolean beforeStartKey(Key key)
public Key getEndKey()
public boolean afterEndKey(Key key)
public boolean equals(Range otherRange)
public int compareTo(Range o)
Key.compareTo(Key)
. Inclusive sorts before non-inclusive.compareTo
in interface Comparable<Range>
public boolean contains(Key key)
public static List<Range> mergeOverlapping(Collection<Range> ranges)
[a,c], (c, d], (g,m), (j,t]the following ranges would be returned
[a,d], (g,t]
public Range clip(Range range)
Range range1 = new Range("a", "f"); Range range2 = new Range("c", "n"); Range range3 = range1.clip(range2); System.out.println(range3.equals(new Range("c", "f")));
IllegalArgumentException
- if ranges does not overlappublic Range clip(Range range, boolean returnNullIfDisjoint)
returnNullIfDisjoint
- If the ranges do not overlap and true is passed, then null is returned otherwise an exception is thrown.clip(Range)
public Range bound(Column min, Column max)
IllegalArgumentException
- if min > maxpublic void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public boolean isStartKeyInclusive()
public boolean isEndKeyInclusive()
public TRange toThrift()
public boolean isInfiniteStartKey()
public boolean isInfiniteStopKey()
public static Range exact(org.apache.hadoop.io.Text row)
row
- all keys in the range will have this rowpublic static Range exact(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf)
row
- all keys in the range will have this rowcf
- all keys in the range will have this column familypublic static Range exact(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cq)
row
- all keys in the range will have this rowcf
- all keys in the range will have this column familycq
- all keys in the range will have this column qualifierpublic static Range exact(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cq, org.apache.hadoop.io.Text cv)
row
- all keys in the range will have this rowcf
- all keys in the range will have this column familycq
- all keys in the range will have this column qualifiercv
- all keys in the range will have this column visibilitypublic static Range exact(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cq, org.apache.hadoop.io.Text cv, long ts)
row
- all keys in the range will have this rowcf
- all keys in the range will have this column familycq
- all keys in the range will have this column qualifiercv
- all keys in the range will have this column visibilityts
- all keys in the range will have this timestamppublic static org.apache.hadoop.io.Text followingPrefix(org.apache.hadoop.io.Text prefix)
public static Range prefix(org.apache.hadoop.io.Text rowPrefix)
rowPrefix
- all keys in the range will have rows that begin with this prefixpublic static Range prefix(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cfPrefix)
row
- all keys in the range will have this rowcfPrefix
- all keys in the range will have column families that begin with this prefixpublic static Range prefix(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cqPrefix)
row
- all keys in the range will have this rowcf
- all keys in the range will have this column familycqPrefix
- all keys in the range will have column qualifiers that begin with this prefixpublic static Range prefix(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cq, org.apache.hadoop.io.Text cvPrefix)
row
- all keys in the range will have this rowcf
- all keys in the range will have this column familycq
- all keys in the range will have this column qualifiercvPrefix
- all keys in the range will have column visibilities that begin with this prefixpublic static Range exact(CharSequence row)
exact(Text)
public static Range exact(CharSequence row, CharSequence cf)
exact(Text, Text)
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq)
exact(Text, Text, Text)
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq, CharSequence cv)
exact(Text, Text, Text, Text)
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq, CharSequence cv, long ts)
exact(Text, Text, Text, Text, long)
public static Range prefix(CharSequence rowPrefix)
prefix(Text)
public static Range prefix(CharSequence row, CharSequence cfPrefix)
prefix(Text, Text)
public static Range prefix(CharSequence row, CharSequence cf, CharSequence cqPrefix)
prefix(Text, Text, Text)
public static Range prefix(CharSequence row, CharSequence cf, CharSequence cq, CharSequence cvPrefix)
prefix(Text, Text, Text, Text)
Copyright © 2014 Apache Accumulo Project. All Rights Reserved.