Product tutorials, how-tos, and fully-documented APIs.

PBC API

    This is an overview of the operations you can perform over the Protocol Buffers Client (PBC) interface to Riak, and can be used as a guide for developing a compliant client.

    Protocol

    Riak listens on a TCP port (8087 by default) for incoming connections. Once connected the client can send a stream of requests on the same connection.

    Each operation consists of a request message and one or more response messages. Messages are all encoded the same way * 32-bit length of message code + protocol buffer message in network order * 8-bit message code to identify the protocol buffer message * N-bytes of protocol buffers encoded message

    Example

    00 00 00 07 09 0A 01 62 12 01 6B
    |----Len---|MC|----Message-----|
    
    Len = 0x07
    Message Code (MC) = 0x09 = RpbGetReq
    RpbGetReq Message = 0x0A 0x01 0x62 0x12 0x01 0x6B
    
    Decoded Message:
    bucket: "b"
    key: "k"
    

    Message Codes

    0RpbErrorResp
    1RpbPingReq
    2RpbPingResp
    3RpbGetClientIdReq
    4RpbGetClientIdResp
    5RpbSetClientIdReq
    6RpbSetClientIdResp
    7RpbGetServerInfoReq
    8RpbGetServerInfoResp
    9RpbGetReq
    10RpbGetResp
    11RpbPutReq
    12RpbPutResp
    13RpbDelReq
    14RpbDelResp
    15RpbListBucketsReq
    16RpbListBucketsResp
    17RpbListKeysReq
    18RpbListKeysResp
    19RpbGetBucketReq
    20RpbGetBucketResp
    21RpbSetBucketReq
    22RpbSetBucketResp
    23RpbMapRedReq
    24RpbMapRedResp
    25RpbIndexReq (new in 1.2+)
    26RpbIndexResp (new in 1.2+)
    27RpbSearchQueryReq (new in 1.2+)
    28RbpSearchQueryResp (new in 1.2+)
    Message Definitions

    All Protocol Buffers messages can be found defined in the riak.proto and other .proto files in the RiakPB project.

    Error Response

    If the server experiences an error processing a request it will return an RpbErrorResp message instead of the response expected for the given request (e.g. RbpGetResp is the expected response to RbpGetReq). Error messages contain an error string and an error code.

    message RpbErrorResp {
        required bytes errmsg = 1;
        required uint32 errcode = 2;
    }
    

    Values:

    Bucket Operations

    Object/Key Operations

    Query Operations

    Server Operations