K
- Type of keysV
- Type of values@InterfaceStability.Evolving public final class RangeQuery<K,V> extends Object implements Query<KeyValueIterator<K,V>>
A range query retrieves a set of records, specified using an upper and/or lower bound on the keys.
A scan query retrieves all records contained in the store.
Keys' order is based on the serialized byte[] of the keys, not the 'logical' key order.
Modifier and Type | Method and Description |
---|---|
Optional<K> |
getLowerBound()
The lower bound of the query, if specified.
|
Optional<K> |
getUpperBound()
The upper bound of the query, if specified
|
ResultOrder |
resultOrder()
Determines if the serialized byte[] of the keys in ascending or descending or unordered order.
|
RangeQuery<K,V> |
withAscendingKeys()
Set the query to return the serialized byte[] of the keys in ascending order.
|
RangeQuery<K,V> |
withDescendingKeys()
Set the query to return the serialized byte[] of the keys in descending order.
|
static <K,V> RangeQuery<K,V> |
withLowerBound(K lower)
Interactive range query using a lower bound to filter the keys returned.
|
static <K,V> RangeQuery<K,V> |
withNoBounds()
Interactive scan query that returns all records in the store.
|
static <K,V> RangeQuery<K,V> |
withRange(K lower,
K upper)
Interactive range query using a lower and upper bound to filter the keys returned.
|
static <K,V> RangeQuery<K,V> |
withUpperBound(K upper)
Interactive range query using an upper bound to filter the keys returned.
|
public static <K,V> RangeQuery<K,V> withRange(K lower, K upper)
K
- The key typeV
- The value typelower
- The key that specifies the lower bound of the rangeupper
- The key that specifies the upper bound of the rangepublic ResultOrder resultOrder()
public RangeQuery<K,V> withDescendingKeys()
public RangeQuery<K,V> withAscendingKeys()
public static <K,V> RangeQuery<K,V> withUpperBound(K upper)
<K,V>
are null, RangQuery returns a full range scan.K
- The key typeV
- The value typeupper
- The key that specifies the upper bound of the rangepublic static <K,V> RangeQuery<K,V> withLowerBound(K lower)
K
- The key typeV
- The value typelower
- The key that specifies the lower bound of the rangepublic static <K,V> RangeQuery<K,V> withNoBounds()
K
- The key typeV
- The value type