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 Detail

      • LOWEST_COMPAT_PROTOCOL_VERSION

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

        static final byte CURRENT_PROTOCOL_VERSION
        Current version of the protocol, which client will use.
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • LAST_ADD_CONFIRMED

        static final long LAST_ADD_CONFIRMED
        Entry identifier representing a request to obtain the last add entry confirmed.
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • ENOLEDGER

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

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

        static final int EBADREQ
        The error code that indicates an invalid request type.
        See Also:
        Constant Field Values
      • EBADVERSION

        static final int EBADVERSION
        The server version is incompatible with the client.
        See Also:
        Constant Field Values
      • EREADONLY

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

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

        static final int EUNKNOWNLEDGERSTATE
        Ledger in unknown state.
        See Also:
        Constant Field Values