|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.data.Range
public class Range
This class is used to specify a range of Accumulo Keys.
Constructor Summary | |
---|---|
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 |
|
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)
|
|
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)
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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)
public Range(TRange trange)
Method Detail |
---|
public Key getStartKey()
public boolean beforeStartKey(Key key)
key
-
public Key getEndKey()
public boolean afterEndKey(Key key)
key
-
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
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)
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]
ranges
-
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")));
range
-
IllegalArgumentException
- if ranges does not overlappublic Range clip(Range range, boolean returnNullIfDisjoint)
range
- 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)
min
- max
-
IllegalArgumentException
- if min > maxpublic String toString()
toString
in class Object
public 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)
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |