Package com.apple.foundationdb.clientlog
Class FDBClientLogEvents
- java.lang.Object
-
- com.apple.foundationdb.clientlog.FDBClientLogEvents
-
@API(EXPERIMENTAL) public class FDBClientLogEvents extends Object
Parse client latency events from system keyspace.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FDBClientLogEvents.AsyncConsumer<T>
Asynchronous callback.static class
FDBClientLogEvents.CommitRequest
Information about a commit, successful or not, in an event.static class
FDBClientLogEvents.Event
Base class for parsed events.static class
FDBClientLogEvents.EventCommit
A commit latency event.static class
FDBClientLogEvents.EventCommitError
A failing commit event.static interface
FDBClientLogEvents.EventConsumer
Event callback.protected static class
FDBClientLogEvents.EventDeserializer
static class
FDBClientLogEvents.EventGet
A single key get latency event.static class
FDBClientLogEvents.EventGetError
A failing single key get event.static class
FDBClientLogEvents.EventGetRange
A range get latency event.static class
FDBClientLogEvents.EventGetRangeError
A failing range get event.static class
FDBClientLogEvents.EventGetVersion
A GRV latency event.static class
FDBClientLogEvents.Mutation
A single mutation in aFDBClientLogEvents.CommitRequest
.
-
Field Summary
Fields Modifier and Type Field Description static int
COMMIT_LATENCY
static int
ERROR_COMMIT
static int
ERROR_GET
static int
ERROR_GET_RANGE
static int
EVENT_KEY_CHUNK_INDEX
static int
EVENT_KEY_ID_END_INDEX
static int
EVENT_KEY_ID_START_INDEX
static int
EVENT_KEY_VERSION_END_INDEX
static int
GET_LATENCY
static int
GET_RANGE_LATENCY
static int
GET_VERSION_LATENCY
static long
PROTOCOL_VERSION_5_2
static long
PROTOCOL_VERSION_6_0
static long
PROTOCOL_VERSION_6_1
static long
PROTOCOL_VERSION_6_2
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static byte[]
deserializeByteArray(ByteBuffer buffer)
protected static FDBClientLogEvents.CommitRequest
deserializeCommit(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 Detail
-
GET_VERSION_LATENCY
public static final int GET_VERSION_LATENCY
- See Also:
- Constant Field Values
-
GET_LATENCY
public static final int GET_LATENCY
- See Also:
- Constant Field Values
-
GET_RANGE_LATENCY
public static final int GET_RANGE_LATENCY
- See Also:
- Constant Field Values
-
COMMIT_LATENCY
public static final int COMMIT_LATENCY
- See Also:
- Constant Field Values
-
ERROR_GET
public static final int ERROR_GET
- See Also:
- Constant Field Values
-
ERROR_GET_RANGE
public static final int ERROR_GET_RANGE
- See Also:
- Constant Field Values
-
ERROR_COMMIT
public static final int ERROR_COMMIT
- See Also:
- Constant Field Values
-
PROTOCOL_VERSION_5_2
public static final long PROTOCOL_VERSION_5_2
- See Also:
- Constant Field Values
-
PROTOCOL_VERSION_6_0
public static final long PROTOCOL_VERSION_6_0
- See Also:
- Constant Field Values
-
PROTOCOL_VERSION_6_1
public static final long PROTOCOL_VERSION_6_1
- See Also:
- Constant Field Values
-
PROTOCOL_VERSION_6_2
public static final long PROTOCOL_VERSION_6_2
- See Also:
- Constant Field Values
-
EVENT_KEY_VERSION_END_INDEX
public static final int EVENT_KEY_VERSION_END_INDEX
- See Also:
- Constant Field Values
-
EVENT_KEY_ID_START_INDEX
public static final int EVENT_KEY_ID_START_INDEX
- See Also:
- Constant Field Values
-
EVENT_KEY_ID_END_INDEX
public static final int EVENT_KEY_ID_END_INDEX
- See Also:
- Constant Field Values
-
EVENT_KEY_CHUNK_INDEX
public static final int EVENT_KEY_CHUNK_INDEX
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
@Nonnull protected static byte[] deserializeByteArray(@Nonnull ByteBuffer buffer)
-
deserializeRange
@Nonnull protected static Range deserializeRange(@Nonnull ByteBuffer buffer)
-
deserializeRangeArray
@Nonnull protected static Range[] deserializeRangeArray(@Nonnull ByteBuffer buffer)
-
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(@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
-
-