Class FDBClientLogEvents

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

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

  • 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 entry
      callback - 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)
      Read a range that was written as its two keys, as the events for reading a range do.
      Parameters:
      buffer - the buffer to read from
      Returns:
      the range
    • deserializeConflictRange

      @Nonnull protected static Range deserializeConflictRange(@Nonnull ByteBuffer buffer)
      Read a conflict range of a commit. Unlike the ranges of the events for reading a range, these are written by FDB's KeyRangeRef::serialize, which writes a range of a single key as just its exclusive end (the key followed by a zero byte) and an empty string.
      Parameters:
      buffer - the buffer to read from
      Returns:
      the range
    • deserializeRangeArray

      @Nonnull protected static Range[] deserializeRangeArray(@Nonnull ByteBuffer buffer)
    • deserializeMutation

      @Nonnull protected static FDBClientLogEvents.Mutation deserializeMutation(long protocolVersion, @Nonnull ByteBuffer buffer)
    • deserializeMutationArray

      @Nonnull protected static FDBClientLogEvents.Mutation[] deserializeMutationArray(long protocolVersion, @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 events
      callback - 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