Package com.apple.foundationdb.clientlog
Class DatabaseClientLogEvents
- java.lang.Object
-
- com.apple.foundationdb.clientlog.DatabaseClientLogEvents
-
@API(EXPERIMENTAL) public class DatabaseClientLogEvents extends Object
Parse client latency events from system keyspace.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DatabaseClientLogEvents.EventConsumer
A callback with the current transaction.protected static class
DatabaseClientLogEvents.EventRunner
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompletableFuture<DatabaseClientLogEvents>
forEachEvent(Database database, Executor executor, DatabaseClientLogEvents.EventConsumer callback, Function<ReadTransaction,CompletableFuture<Long[]>> versionRangeProducer, int eventCountLimit, long timeLimitMillis)
static CompletableFuture<DatabaseClientLogEvents>
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.static CompletableFuture<DatabaseClientLogEvents>
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.CompletableFuture<DatabaseClientLogEvents>
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.Instant
getEarliestTimestamp()
int
getEventCount()
Instant
getLatestTimestamp()
boolean
hasMore()
-
-
-
Method Detail
-
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
-
-