Package com.apple.foundationdb.clientlog
Class VersionFromTimestamp
java.lang.Object
com.apple.foundationdb.clientlog.VersionFromTimestamp
Map from wall-clock time to transaction time.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<Long>
lastVersionBefore
(ReadTransaction tr, Instant timestamp) Get the last version from the timekeeper at or before the given timestamp.static CompletableFuture<Long>
nextVersionAfter
(ReadTransaction tr, Instant timestamp) Get the first version from the timekeeper at or after the given timestamp.
-
Method Details
-
lastVersionBefore
@Nonnull public static CompletableFuture<Long> lastVersionBefore(@Nonnull ReadTransaction tr, @Nonnull Instant timestamp) Get the last version from the timekeeper at or before the given timestamp.- Parameters:
tr
- an open transactiontimestamp
- the wall-clock time- Returns:
- a future that completes with the recorded version that comes immediately before the target time
-
nextVersionAfter
@Nonnull public static CompletableFuture<Long> nextVersionAfter(@Nonnull ReadTransaction tr, @Nonnull Instant timestamp) Get the first version from the timekeeper at or after the given timestamp.- Parameters:
tr
- an open transactiontimestamp
- the wall-clock time- Returns:
- a future that completes with the recorded version that comes immediately after the target time
-