Package com.apple.foundationdb.clientlog
Class VersionFromTimestamp
- java.lang.Object
-
- com.apple.foundationdb.clientlog.VersionFromTimestamp
-
@API(EXPERIMENTAL) public class VersionFromTimestamp extends Object
Map from wall-clock time to transaction time.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
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
-
-