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 Classes Modifier and Type Interface Description static class
BookieProtocol.AddResponse
A response that adds data.static class
BookieProtocol.AuthRequest
An authentication request.static class
BookieProtocol.AuthResponse
A response with an authentication message.static class
BookieProtocol.BatchedReadRequest
The request for reading data with batch optimization.static class
BookieProtocol.BatchedReadResponse
The response for batched read.static class
BookieProtocol.ErrorResponse
An error response.static class
BookieProtocol.PacketHeader
The first int of a packet is the header.static class
BookieProtocol.ParsedAddRequest
This is similar to add request, but it used when processing the request on the bookie side.static class
BookieProtocol.ReadRequest
A Request that reads data.static class
BookieProtocol.ReadResponse
A request that reads data.static class
BookieProtocol.Request
A Bookie request object.static class
BookieProtocol.Response
A response object.
-
Field Summary
Fields Modifier and Type Field Description static byte
ADDENTRY
The Add entry request payload will be a ledger entry exactly as it should be logged.static byte
AUTH
Auth message.static byte
BATCH_READ_ENTRY
static byte
CURRENT_PROTOCOL_VERSION
Current version of the protocol, which client will use.static int
EBADREQ
The error code that indicates an invalid request type.static int
EBADVERSION
The server version is incompatible with the client.static int
EFENCED
Attempt to write to fenced ledger.static int
EIO
General error occurred at the server.static int
ENOENTRY
The error code that indicates that the requested entry does not exist.static int
ENOLEDGER
The error code that indicates that the ledger does not exist.static int
EOK
The error code that indicates success.static int
EREADONLY
The server is running as read-only mode.static int
ETOOMANYREQUESTS
Too many concurrent requests.static int
EUA
Unauthorized access to ledger.static int
EUNKNOWNLEDGERSTATE
Ledger in unknown state.static short
FLAG_DO_FENCING
static short
FLAG_HIGH_PRIORITY
static short
FLAG_NONE
static short
FLAG_RECOVERY_ADD
static byte
GET_BOOKIE_INFO
static long
INVALID_ENTRY_ID
Entry Entry ID.static long
LAST_ADD_CONFIRMED
Entry identifier representing a request to obtain the last add entry confirmed.static byte
LOWEST_COMPAT_PROTOCOL_VERSION
Lowest protocol version which will work with the bookie.static int
MASTER_KEY_LENGTH
The length of the master key in add packets.static byte
READ_LAC
static byte
READENTRY
The Read entry request payload will be the ledger number and entry number to read.static byte
WRITE_LAC
-
-
-
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
-
READ_LAC
static final byte READ_LAC
- See Also:
- Constant Field Values
-
WRITE_LAC
static final byte WRITE_LAC
- See Also:
- Constant Field Values
-
GET_BOOKIE_INFO
static final byte GET_BOOKIE_INFO
- See Also:
- Constant Field Values
-
BATCH_READ_ENTRY
static final byte BATCH_READ_ENTRY
- See Also:
- Constant Field Values
-
EOK
static final int EOK
The error code that indicates success.- 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
-
EIO
static final int EIO
General error occurred at the server.- See Also:
- Constant Field Values
-
EUA
static final int EUA
Unauthorized access to ledger.- See Also:
- Constant Field Values
-
EBADVERSION
static final int EBADVERSION
The server version is incompatible with the client.- See Also:
- Constant Field Values
-
EFENCED
static final int EFENCED
Attempt to write to fenced ledger.- 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
-
FLAG_NONE
static final short FLAG_NONE
- See Also:
- Constant Field Values
-
FLAG_DO_FENCING
static final short FLAG_DO_FENCING
- See Also:
- Constant Field Values
-
FLAG_RECOVERY_ADD
static final short FLAG_RECOVERY_ADD
- See Also:
- Constant Field Values
-
FLAG_HIGH_PRIORITY
static final short FLAG_HIGH_PRIORITY
- See Also:
- Constant Field Values
-
-