Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The methods are composable. The from and asOf methods specify the time range.
    • If a user applies the same time limit multiple times such as MultiVersionedKeyQuery.withKey(k).from(t1).from(t2), then the last one wins (it will be translated to MultiVersionedKeyQuery.withKey(k).from(t2)).

    • Defining a query with time range (empty, t1] will be translated into [0, t1] (calling only the from method).
    • Defining a query with time range (t1, empty) will be translated into [t1, MAX) (calling only the asOf method).
    • A query with no specified time range will be translated into [0, MAX). It mean means that the query will return all the versions of the records with specified key.
  • 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. For example, if the record (k,v) has been inserted at time=0, it will be returned by the multi versioned key queries with key=k and fromTimestamp>=0. Obviously, if the record (k,v) becomes tombstone at time=2, then the multi versioned key queries with key=k and fromTimestamp>=2 will not return it any more. In this case, the multi versioned key queries with key=k and fromTimestamp<2 will return the record (k,v) validTo=2.
    • The asOfTimestamp specifies the ending point. Records that have been inserted at asOfTimestamp are returned by the query as well.
  • The order of the returned records is by default ascending by timestamp. The method withDescendingTimestamps() can reverse the order. Btw, withAscendingTimestamps() method can be used for code readability purpose. 

...