Interface BookieProtocol


public interface BookieProtocol
The packets of the Bookie protocol all have a 4-byte integer indicating the type of request or response at the very beginning of the packet followed by a payload.
  • Field Details

    • LOWEST_COMPAT_PROTOCOL_VERSION

      static final byte LOWEST_COMPAT_PROTOCOL_VERSION
      Lowest protocol version which will work with the bookie.
      See Also:
    • CURRENT_PROTOCOL_VERSION

      static final byte CURRENT_PROTOCOL_VERSION
      Current version of the protocol, which client will use.
      See Also:
    • INVALID_ENTRY_ID

      static final long INVALID_ENTRY_ID
      Entry Entry ID. To be used when no valid entry id can be assigned.
      See Also:
    • LAST_ADD_CONFIRMED

      static final long LAST_ADD_CONFIRMED
      Entry identifier representing a request to obtain the last add entry confirmed.
      See Also:
    • MASTER_KEY_LENGTH

      static final int MASTER_KEY_LENGTH
      The length of the master key in add packets. This is fixed at 20 for historic reasons. This is because it is always generated using the MacDigestManager regardless of whether Mac is being used for the digest or not
      See Also:
    • ADDENTRY

      static final byte ADDENTRY
      The Add entry request payload will be a ledger entry exactly as it should be logged. The response payload will be a 4-byte integer that has the error code followed by the 8-byte ledger number and 8-byte entry number of the entry written.
      See Also:
    • READENTRY

      static final byte READENTRY
      The Read entry request payload will be the ledger number and entry number to read. (The ledger number is an 8-byte integer and the entry number is a 8-byte integer.) The response payload will be a 4-byte integer representing an error code and a ledger entry if the error code is EOK, otherwise it will be the 8-byte ledger number and the 4-byte entry number requested. (Note that the first sixteen bytes of the entry happen to be the ledger number and entry number as well.)
      See Also:
    • AUTH

      static final byte AUTH
      Auth message. This code is for passing auth messages between the auth providers on the client and bookie. The message payload is determined by the auth providers themselves.
      See Also:
    • READ_LAC

      static final byte READ_LAC
      See Also:
    • WRITE_LAC

      static final byte WRITE_LAC
      See Also:
    • GET_BOOKIE_INFO

      static final byte GET_BOOKIE_INFO
      See Also:
    • BATCH_READ_ENTRY

      static final byte BATCH_READ_ENTRY
      See Also:
    • EOK

      static final int EOK
      The error code that indicates success.
      See Also:
    • ENOLEDGER

      static final int ENOLEDGER
      The error code that indicates that the ledger does not exist.
      See Also:
    • ENOENTRY

      static final int ENOENTRY
      The error code that indicates that the requested entry does not exist.
      See Also:
    • EBADREQ

      static final int EBADREQ
      The error code that indicates an invalid request type.
      See Also:
    • EIO

      static final int EIO
      General error occurred at the server.
      See Also:
    • EUA

      static final int EUA
      Unauthorized access to ledger.
      See Also:
    • EBADVERSION

      static final int EBADVERSION
      The server version is incompatible with the client.
      See Also:
    • EFENCED

      static final int EFENCED
      Attempt to write to fenced ledger.
      See Also:
    • EREADONLY

      static final int EREADONLY
      The server is running as read-only mode.
      See Also:
    • ETOOMANYREQUESTS

      static final int ETOOMANYREQUESTS
      Too many concurrent requests.
      See Also:
    • EUNKNOWNLEDGERSTATE

      static final int EUNKNOWNLEDGERSTATE
      Ledger in unknown state.
      See Also:
    • FLAG_NONE

      static final short FLAG_NONE
      See Also:
    • FLAG_DO_FENCING

      static final short FLAG_DO_FENCING
      See Also:
    • FLAG_RECOVERY_ADD

      static final short FLAG_RECOVERY_ADD
      See Also:
    • FLAG_HIGH_PRIORITY

      static final short FLAG_HIGH_PRIORITY
      See Also: