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(org.apache.accumulo.core.data.thrift.TRange trange)
Creates a range from a Thrift range.
|
Modifier and Type | Method and Description |
---|---|
boolean |
afterEndKey(Key key)
Determines if the given key is after the ending key of this range.
|
boolean |
beforeStartKey(Key key)
Determines if the given key is before the start key of this range.
|
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)
Creates a range which represents the intersection of this range and the passed in range.
|
int |
compareTo(Range o)
Compares this range to another range.
|
boolean |
contains(Key key)
Determines if the given key falls within this range.
|
boolean |
equals(Object o) |
boolean |
equals(Range otherRange)
Determines if this range equals another.
|
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 column 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, column visibility, and timestamp.
|
static Range |
exact(org.apache.hadoop.io.Text row)
Creates a range that covers an exact 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 column 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, column 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()
Gets the ending key, or null if the end is positive infinity.
|
Key |
getStartKey()
Gets the start key, or null if the start is negative infinity.
|
int |
hashCode() |
boolean |
isEndKeyInclusive()
Gets whether the end key of this range is inclusive.
|
boolean |
isInfiniteStartKey()
Gets whether the start key is negative infinity.
|
boolean |
isInfiniteStopKey()
Gets whether the end key is positive infinity.
|
boolean |
isStartKeyInclusive()
Gets whether the start key of this range is inclusive.
|
static List<Range> |
mergeOverlapping(Collection<Range> ranges)
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() |
org.apache.accumulo.core.data.thrift.TRange |
toThrift()
Converts this range to Thrift.
|
void |
write(DataOutput out) |
public Range()
public Range(Key startKey, Key endKey)
startKey
- starting key; set to null for negative infinityendKey
- ending key; set to null for positive infinityIllegalArgumentException
- if end key is before start keypublic Range(CharSequence row)
row
- row to cover; set to null to cover all rowspublic Range(org.apache.hadoop.io.Text row)
row
- row to cover; set to null to cover all rowspublic Range(org.apache.hadoop.io.Text startRow, org.apache.hadoop.io.Text endRow)
startRow
- starting row; set to null for negative infinityendRow
- ending row; set to null for positive infinityIllegalArgumentException
- if end row is before start rowpublic Range(CharSequence startRow, CharSequence endRow)
startRow
- starting row; set to null for negative infinityendRow
- ending row; set to null for positive infinityIllegalArgumentException
- if end row is before start rowpublic Range(org.apache.hadoop.io.Text startRow, boolean startRowInclusive, org.apache.hadoop.io.Text endRow, boolean endRowInclusive)
startRow
- starting row; set to null for negative infinitystartRowInclusive
- true to include start row, false to skipendRow
- ending row; set to null for positive infinityendRowInclusive
- true to include start row, false to skipIllegalArgumentException
- if end row is before start rowpublic Range(CharSequence startRow, boolean startRowInclusive, CharSequence endRow, boolean endRowInclusive)
startRow
- starting row; set to null for negative infinitystartRowInclusive
- true to include start row, false to skipendRow
- ending row; set to null for positive infinityendRowInclusive
- true to include start row, false to skipIllegalArgumentException
- if end row is before start rowpublic Range(Key startKey, boolean startKeyInclusive, Key endKey, boolean endKeyInclusive)
startKey
- starting key; set to null for negative infinitystartKeyInclusive
- true to include start key, false to skipendKey
- ending key; set to null for positive infinityendKeyInclusive
- true to include start key, false to skipIllegalArgumentException
- if end key is before start keypublic Range(Range range)
range
- range to copypublic 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(org.apache.accumulo.core.data.thrift.TRange trange)
trange
- Thrift rangepublic Key getStartKey()
public boolean beforeStartKey(Key key)
key
- key to checkpublic Key getEndKey()
public boolean afterEndKey(Key key)
key
- key to checkpublic boolean equals(Range otherRange)
otherRange
- range to comparecompareTo(Range)
public int compareTo(Range o)
Key.compareTo(Key)
. Inclusive sorts before non-inclusive.compareTo
in interface Comparable<Range>
o
- range to comparepublic boolean contains(Key key)
key
- key to considerpublic 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
- to mergepublic 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
- range to clip toIllegalArgumentException
- if ranges does not overlappublic Range clip(Range range, boolean returnNullIfDisjoint)
clip(Range)
, this method can optionally return
null if the ranges do not overlap, instead of throwing an exception. The returnNullIfDisjoint parameter controls this behavior.range
- range to clip toreturnNullIfDisjoint
- true to return null if ranges are disjoint, false to throw an exceptionIllegalArgumentException
- if ranges does not overlap and returnNullIfDisjoint is falseclip(Range)
public Range bound(Column min, Column max)
min
- minimum columnmax
- maximum columnIllegalArgumentException
- if the minimum column compares greater than the maximum columnpublic 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 org.apache.accumulo.core.data.thrift.TRange toThrift()
public boolean isInfiniteStartKey()
public boolean isInfiniteStopKey()
public static Range exact(org.apache.hadoop.io.Text row)
Range(Text)
.row
- row to cover; set to null to cover all rowspublic static Range exact(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf)
row
- row row to covercf
- column family to coverpublic static Range exact(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cq)
row
- row row to covercf
- column family to covercq
- column qualifier to coverpublic 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
- row row to covercf
- column family to covercq
- column qualifier to covercv
- column visibility to coverpublic 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
- row row to covercf
- column family to covercq
- column qualifier to covercv
- column visibility to coverts
- timestamp to coverpublic static org.apache.hadoop.io.Text followingPrefix(org.apache.hadoop.io.Text prefix)
prefix
- to followpublic static Range prefix(org.apache.hadoop.io.Text rowPrefix)
rowPrefix
- prefix of rows to coverpublic static Range prefix(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cfPrefix)
row
- row to covercfPrefix
- prefix of column families to coverpublic static Range prefix(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cqPrefix)
row
- row to covercf
- column family to covercqPrefix
- prefix of column qualifiers to coverpublic 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
- row to covercf
- column family to covercq
- column qualifier to covercvPrefix
- prefix of column visibilities to coverpublic static Range exact(CharSequence row)
row
- row to cover; set to null to cover all rowsexact(Text)
public static Range exact(CharSequence row, CharSequence cf)
row
- row row to covercf
- column family to coverexact(Text, Text)
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq)
row
- row row to covercf
- column family to covercq
- column qualifier to coverexact(Text, Text, Text)
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq, CharSequence cv)
row
- row row to covercf
- column family to covercq
- column qualifier to covercv
- column visibility to coverexact(Text, Text, Text, Text)
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq, CharSequence cv, long ts)
row
- row row to covercf
- column family to covercq
- column qualifier to covercv
- column visibility to coverts
- timestamp to coverexact(Text, Text, Text, Text, long)
public static Range prefix(CharSequence rowPrefix)
rowPrefix
- prefix of rows to coverprefix(Text)
public static Range prefix(CharSequence row, CharSequence cfPrefix)
row
- row to covercfPrefix
- prefix of column families to coverprefix(Text, Text)
public static Range prefix(CharSequence row, CharSequence cf, CharSequence cqPrefix)
row
- row to covercf
- column family to covercqPrefix
- prefix of column qualifiers to coverprefix(Text, Text, Text)
public static Range prefix(CharSequence row, CharSequence cf, CharSequence cq, CharSequence cvPrefix)
row
- row to covercf
- column family to covercq
- column qualifier to covercvPrefix
- prefix of column visibilities to coverprefix(Text, Text, Text, Text)
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.