Package com.apple.foundationdb.clientlog
Class FDBClientLogEvents
java.lang.Object
com.apple.foundationdb.clientlog.FDBClientLogEvents
Parse client latency events from system keyspace.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Asynchronous callback.static class
Information about a commit, successful or not, in an event.static class
Base class for parsed events.static class
A commit latency event.static class
A failing commit event.static interface
Event callback.protected static class
static class
A single key get latency event.static class
A failing single key get event.static class
A range get latency event.static class
A failing range get event.static class
A GRV latency event.static class
A single mutation in aFDBClientLogEvents.CommitRequest
.protected static class
protected static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
-
Method Summary
Modifier and TypeMethodDescriptionprotected static byte[]
deserializeByteArray
(ByteBuffer buffer) protected static FDBClientLogEvents.CommitRequest
deserializeCommit
(long protocolVersion, ByteBuffer buffer) static CompletableFuture<Void>
deserializeEvents
(ByteBuffer buffer, FDBClientLogEvents.AsyncConsumer<FDBClientLogEvents.Event> callback) Apply a callback to parsed events.protected static FDBClientLogEvents.Mutation
deserializeMutation
(ByteBuffer buffer) protected static FDBClientLogEvents.Mutation[]
deserializeMutationArray
(ByteBuffer buffer) protected static Range
deserializeRange
(ByteBuffer buffer) protected static Range[]
deserializeRangeArray
(ByteBuffer buffer) static byte[]
eventKeyForVersion
(long version) Get the key at which a particular commit version would be recorded.static CompletableFuture<byte[]>
forEachEvent
(AsyncIterable<KeyValue> range, FDBClientLogEvents.EventConsumer callback) Invoke a callback on each event in a range of the key-value store.
-
Field Details
-
GET_VERSION_LATENCY
public static final int GET_VERSION_LATENCY- See Also:
-
GET_LATENCY
public static final int GET_LATENCY- See Also:
-
GET_RANGE_LATENCY
public static final int GET_RANGE_LATENCY- See Also:
-
COMMIT_LATENCY
public static final int COMMIT_LATENCY- See Also:
-
ERROR_GET
public static final int ERROR_GET- See Also:
-
ERROR_GET_RANGE
public static final int ERROR_GET_RANGE- See Also:
-
ERROR_COMMIT
public static final int ERROR_COMMIT- See Also:
-
PROTOCOL_VERSION_5_2
public static final long PROTOCOL_VERSION_5_2- See Also:
-
PROTOCOL_VERSION_6_0
public static final long PROTOCOL_VERSION_6_0- See Also:
-
PROTOCOL_VERSION_6_1
public static final long PROTOCOL_VERSION_6_1- See Also:
-
PROTOCOL_VERSION_6_2
public static final long PROTOCOL_VERSION_6_2- See Also:
-
PROTOCOL_VERSION_6_3
public static final long PROTOCOL_VERSION_6_3- See Also:
-
PROTOCOL_VERSION_7_0
public static final long PROTOCOL_VERSION_7_0- See Also:
-
PROTOCOL_VERSION_7_1
public static final long PROTOCOL_VERSION_7_1- See Also:
-
PROTOCOL_VERSION_7_2
public static final long PROTOCOL_VERSION_7_2- See Also:
-
PROTOCOL_VERSION_7_3
public static final long PROTOCOL_VERSION_7_3- See Also:
-
EVENT_KEY_VERSION_END_INDEX
public static final int EVENT_KEY_VERSION_END_INDEX- See Also:
-
EVENT_KEY_ID_START_INDEX
public static final int EVENT_KEY_ID_START_INDEX- See Also:
-
EVENT_KEY_ID_END_INDEX
public static final int EVENT_KEY_ID_END_INDEX- See Also:
-
EVENT_KEY_CHUNK_INDEX
public static final int EVENT_KEY_CHUNK_INDEX- See Also:
-
-
Method Details
-
deserializeEvents
public static CompletableFuture<Void> deserializeEvents(@Nonnull ByteBuffer buffer, @Nonnull FDBClientLogEvents.AsyncConsumer<FDBClientLogEvents.Event> callback) Apply a callback to parsed events.- Parameters:
buffer
- the transaction's client trace entrycallback
- an asynchronous function to apply to each entry- Returns:
- a future that completes when all items have been processed
-
deserializeByteArray
-
deserializeRange
-
deserializeRangeArray
-
deserializeMutation
@Nonnull protected static FDBClientLogEvents.Mutation deserializeMutation(@Nonnull ByteBuffer buffer) -
deserializeMutationArray
@Nonnull protected static FDBClientLogEvents.Mutation[] deserializeMutationArray(@Nonnull ByteBuffer buffer) -
deserializeCommit
@Nonnull protected static FDBClientLogEvents.CommitRequest deserializeCommit(long protocolVersion, @Nonnull ByteBuffer buffer) -
forEachEvent
@Nonnull public static CompletableFuture<byte[]> forEachEvent(@Nonnull AsyncIterable<KeyValue> range, @Nonnull FDBClientLogEvents.EventConsumer callback) Invoke a callback on each event in a range of the key-value store.- Parameters:
range
- the range from which to parse eventscallback
- the callback to invoke- Returns:
- a future which completes when all (whole) events in the range have been processed
-
eventKeyForVersion
@Nonnull public static byte[] eventKeyForVersion(long version) Get the key at which a particular commit version would be recorded.- Parameters:
version
- the version, in the same extent as, e.g.,ReadTransaction.getReadVersion()
- Returns:
- the encoded key
-