K
- The type of the key.V
- The type of the result returned by this query.@InterfaceStability.Evolving public final class MultiVersionedKeyQuery<K,V> extends Object implements Query<VersionedRecordIterator<V>>
Modifier and Type | Method and Description |
---|---|
Optional<Instant> |
fromTime()
The starting time point of the query, if specified
|
MultiVersionedKeyQuery<K,V> |
fromTime(Instant fromTime)
Specifies the starting time point for the key query.
|
K |
key()
The key that was specified for this query.
|
ResultOrder |
resultOrder()
The order of the returned records by timestamp.
|
Optional<Instant> |
toTime()
The ending time point of the query, if specified
|
MultiVersionedKeyQuery<K,V> |
toTime(Instant toTime)
Specifies the ending time point for the key query.
|
MultiVersionedKeyQuery<K,V> |
withAscendingTimestamps()
Specifies the order of the returned records by the query as ascending by timestamp.
|
MultiVersionedKeyQuery<K,V> |
withDescendingTimestamps()
Specifies the order of the returned records by the query as descending by timestamp.
|
static <K,V> MultiVersionedKeyQuery<K,V> |
withKey(K key)
Creates a query that will retrieve the set of records identified by
key if any exists
(or null otherwise). |
public static <K,V> MultiVersionedKeyQuery<K,V> withKey(K key)
key
if any exists
(or null
otherwise).
While the query by default returns the all the record versions of the specified key
, setting
the fromTimestamp
(by calling the fromTime(Instant)
method), and the toTimestamp
(by calling the toTime(Instant)
method) makes the query to return the record versions associated
to the specified time range.
K
- The type of the keyV
- The type of the value that will be retrievedkey
- The specified key by the queryNullPointerException
- if key
is nullpublic MultiVersionedKeyQuery<K,V> fromTime(Instant fromTime)
The key query returns all the records that are still existing in the time range starting from the timestamp fromTime
. There can
be records which have been inserted before the fromTime
and are still valid in the query specified time range (the whole time range
or even partially). The key query in fact returns all the records that have NOT become tombstone at or after fromTime
.
fromTime
- The starting time point
If fromTime
is null, it will be considered as negative infinity, ie, no lower boundpublic MultiVersionedKeyQuery<K,V> toTime(Instant toTime)
toTime
- The ending time point
If @param toTime is null, will be considered as positive infinity, ie, no upper boundpublic MultiVersionedKeyQuery<K,V> withDescendingTimestamps()
public MultiVersionedKeyQuery<K,V> withAscendingTimestamps()
public K key()
key
of the query.public Optional<Instant> fromTime()
fromTime
of the query.public Optional<Instant> toTime()
toTime
of the query.public ResultOrder resultOrder()