Package com.apple.foundationdb.clientlog
Class DatabaseClientLogEvents
java.lang.Object
com.apple.foundationdb.clientlog.DatabaseClientLogEvents
Parse client latency events from system keyspace.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
A callback with the current transaction.protected static class
-
Method Summary
Modifier and TypeMethodDescriptionforEachEvent
(Database database, Executor executor, DatabaseClientLogEvents.EventConsumer callback, Function<ReadTransaction, CompletableFuture<Long[]>> versionRangeProducer, int eventCountLimit, long timeLimitMillis) forEachEventBetweenTimestamps
(Database database, Executor executor, DatabaseClientLogEvents.EventConsumer callback, Instant startTimestamp, Instant endTimestamp, int eventCountLimit, long timeLimitMillis) Apply a callback to client latency events recorded in the given database between two commit versions.forEachEventBetweenVersions
(Database database, Executor executor, DatabaseClientLogEvents.EventConsumer callback, Long startVersion, Long endVersion, int eventCountLimit, long timeLimitMillis) Apply a callback to client latency events recorded in the given database between two commit versions.forEachEventContinued
(Database database, Executor executor, DatabaseClientLogEvents.EventConsumer callback, int eventCountLimit, long timeLimitMillis) Apply a callback to client latency events following an early return due to reaching a limit.int
boolean
hasMore()
-
Method Details
-
getEarliestTimestamp
-
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 fromexecutor
- executor to use when running transactionscallback
- the callback to applystartVersion
- the starting commit versionendVersion
- the exclusive end versioneventCountLimit
- the maximum number of events to process before returningtimeLimitMillis
- 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 fromexecutor
- executor to use when running transactionscallback
- the callback to applystartTimestamp
- the starting wall-clock timeendTimestamp
- the exclusive end timeeventCountLimit
- the maximum number of events to process before returningtimeLimitMillis
- 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 fromexecutor
- executor to use when running transactionscallback
- the callback to applyeventCountLimit
- the maximum number of events to process before returningtimeLimitMillis
- 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
-