...
In this KIP we propose the public classes, VersionedRangeQuery MultiVersionedRangeQuery that will be described in the next section.
...
For supporting range queries, VersionedRangeQuery MultiVersionedRangeQuery class is used.
- The methods are composable. Therefore, the meaningless combinations such as withRange(k1, k2).asOf(t1).allVersions() end up throwing a RunTimeException (for example NotSupportedException).
- Defining a query with time range (empty, t1] will be translated into [0, t1]
- Defining a query with time range (t1, empty) will be translated into [t1, MAX)
- A query with no specified time range will be interpreted as a normal range query that returns the records with the latest timestamp.
- As explained in the javadocs, the query returns all valid records within the specified time range.
- The fromTimestamp specifies the starting point. There can be records which have been inserted before the fromTimestamp and are valid in the time range.
- The asOfTimestamp specifies the ending point. Records that have been inserted at asOfTimestamp are returned by the query as well.
- The overall order of the returned records is by Key. The method orderByTimestamp() can make the overall order by timestamp.
- The order for both key and timestamp is by default ascending. They can be changed by the methods withDescendingKeys() and withDescendingTimestamps() respectively.
...