Package org.apache.bookkeeper.proto
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA response that adds data.static classAn authentication request.static classA response with an authentication message.static classThe request for reading data with batch optimization.static classThe response for batched read.static classAn error response.static final classThe first int of a packet is the header.static classThis is similar to add request, but it used when processing the request on the bookie side.static classA Request that reads data.static classA request that reads data.static classA Bookie request object.static classA response object. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteThe Add entry request payload will be a ledger entry exactly as it should be logged.static final byteAuth message.static final bytestatic final byteCurrent version of the protocol, which client will use.static final intThe error code that indicates an invalid request type.static final intThe server version is incompatible with the client.static final intAttempt to write to fenced ledger.static final intGeneral error occurred at the server.static final intThe error code that indicates that the requested entry does not exist.static final intThe error code that indicates that the ledger does not exist.static final intThe error code that indicates success.static final intThe server is running as read-only mode.static final intToo many concurrent requests.static final intUnauthorized access to ledger.static final intLedger in unknown state.static final shortstatic final shortstatic final shortstatic final shortstatic final bytestatic final longEntry Entry ID.static final longEntry identifier representing a request to obtain the last add entry confirmed.static final byteLowest protocol version which will work with the bookie.static final intThe length of the master key in add packets.static final bytestatic final byteThe Read entry request payload will be the ledger number and entry number to read.static final byte
-
Field Details
-
LOWEST_COMPAT_PROTOCOL_VERSION
static final byte LOWEST_COMPAT_PROTOCOL_VERSIONLowest protocol version which will work with the bookie.- See Also:
-
CURRENT_PROTOCOL_VERSION
static final byte CURRENT_PROTOCOL_VERSIONCurrent version of the protocol, which client will use.- See Also:
-
INVALID_ENTRY_ID
static final long INVALID_ENTRY_IDEntry Entry ID. To be used when no valid entry id can be assigned.- See Also:
-
LAST_ADD_CONFIRMED
static final long LAST_ADD_CONFIRMEDEntry identifier representing a request to obtain the last add entry confirmed.- See Also:
-
MASTER_KEY_LENGTH
static final int MASTER_KEY_LENGTHThe 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 ADDENTRYThe 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 READENTRYThe 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 AUTHAuth 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 EOKThe error code that indicates success.- See Also:
-
ENOLEDGER
static final int ENOLEDGERThe error code that indicates that the ledger does not exist.- See Also:
-
ENOENTRY
static final int ENOENTRYThe error code that indicates that the requested entry does not exist.- See Also:
-
EBADREQ
static final int EBADREQThe error code that indicates an invalid request type.- See Also:
-
EIO
static final int EIOGeneral error occurred at the server.- See Also:
-
EUA
static final int EUAUnauthorized access to ledger.- See Also:
-
EBADVERSION
static final int EBADVERSIONThe server version is incompatible with the client.- See Also:
-
EFENCED
static final int EFENCEDAttempt to write to fenced ledger.- See Also:
-
EREADONLY
static final int EREADONLYThe server is running as read-only mode.- See Also:
-
ETOOMANYREQUESTS
static final int ETOOMANYREQUESTSToo many concurrent requests.- See Also:
-
EUNKNOWNLEDGERSTATE
static final int EUNKNOWNLEDGERSTATELedger 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:
-