Class DatabaseClientLogEvents

java.lang.Object
com.apple.foundationdb.clientlog.DatabaseClientLogEvents

@API(EXPERIMENTAL) public class DatabaseClientLogEvents extends Object
Parse client latency events from system keyspace.
  • Method Details

    • getEarliestTimestamp

      @Nullable public Instant getEarliestTimestamp()
    • getLatestTimestamp

      @Nullable public Instant getLatestTimestamp()
    • getEventCount

      public int getEventCount()
    • hasMore

      public boolean hasMore()
    • forEachEvent

      @Nonnull public static CompletableFuture<DatabaseClientLogEvents> forEachEvent(@Nonnull Database database, @Nonnull Executor executor, @Nonnull DatabaseClientLogEvents.EventConsumer callback, @Nonnull Function<ReadTransaction,CompletableFuture<Long[]>> versionRangeProducer, int eventCountLimit, long timeLimitMillis)
    • forEachEventBetweenVersions

      @Nonnull public static CompletableFuture<DatabaseClientLogEvents> forEachEventBetweenVersions(@Nonnull Database database, @Nonnull Executor executor, @Nonnull DatabaseClientLogEvents.EventConsumer callback, @Nullable Long startVersion, @Nullable Long endVersion, int eventCountLimit, long timeLimitMillis)
      Apply a callback to client latency events recorded in the given database between two commit versions.
      Parameters:
      database - the database to open and read events from
      executor - executor to use when running transactions
      callback - the callback to apply
      startVersion - the starting commit version
      endVersion - the exclusive end version
      eventCountLimit - the maximum number of events to process before returning
      timeLimitMillis - the maximum time to process before returning
      Returns:
      a future which completes when the version range has been processed by the callback with an object that can be used to resume the scan
    • forEachEventBetweenTimestamps

      @Nonnull public static CompletableFuture<DatabaseClientLogEvents> forEachEventBetweenTimestamps(@Nonnull Database database, @Nonnull Executor executor, @Nonnull DatabaseClientLogEvents.EventConsumer callback, @Nullable Instant startTimestamp, @Nullable Instant endTimestamp, int eventCountLimit, long timeLimitMillis)
      Apply a callback to client latency events recorded in the given database between two commit versions.
      Parameters:
      database - the database to open and read events from
      executor - executor to use when running transactions
      callback - the callback to apply
      startTimestamp - the starting wall-clock time
      endTimestamp - the exclusive end time
      eventCountLimit - the maximum number of events to process before returning
      timeLimitMillis - the maximum time to process before returning
      Returns:
      a future which completes when the version range has been processed by the callback with an object that can be used to resume the scan
    • forEachEventContinued

      public CompletableFuture<DatabaseClientLogEvents> forEachEventContinued(@Nonnull Database database, @Nonnull Executor executor, @Nonnull DatabaseClientLogEvents.EventConsumer callback, int eventCountLimit, long timeLimitMillis)
      Apply a callback to client latency events following an early return due to reaching a limit.
      Parameters:
      database - the database to open and read events from
      executor - executor to use when running transactions
      callback - the callback to apply
      eventCountLimit - the maximum number of events to process before returning
      timeLimitMillis - the maximum time to process before returning
      Returns:
      a future which completes when the version range has been processed by the callback with an object that can be used to resume the scan again