Class VersionFromTimestamp


  • @API(EXPERIMENTAL)
    public class VersionFromTimestamp
    extends Object
    Map from wall-clock time to transaction time.
    • 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 transaction
        timestamp - 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 transaction
        timestamp - the wall-clock time
        Returns:
        a future that completes with the recorded version that comes immediately after the target time