Skip to content

Riak 1.4 protobuf support. #19

Closed
wants to merge 1 commit into from

2 participants

@markhibberd

This change introduces new message types and adds fields to some existing types.

This is an initial step to just get the messages in, I then have some follow up changes to add support for 2i. Let me know if this is helpful or not, or if you would like to discuss the changes further.

Note well that i have not touched any of the version information in either of the cabal files, this would need to be tweaked to ensure the client and protobufs components stay in sync.

New Messages:

  • Network.Riak.Protocol.BucketProps.ReplMode
  • Network.Riak.Protocol.CSBucketRequest
  • Network.Riak.Protocol.CSBucketResponse
  • Network.Riak.Protocol.CommitHook
  • Network.Riak.Protocol.CounterGetRequest
  • Network.Riak.Protocol.CounterGetResponse
  • Network.Riak.Protocol.CounterUpdateRequest
  • Network.Riak.Protocol.CounterUpdateResponse
  • Network.Riak.Protocol.IndexObject
  • Network.Riak.Protocol.IndexRequest
  • Network.Riak.Protocol.IndexRequest.IndexQueryType
  • Network.Riak.Protocol.IndexResponse
  • Network.Riak.Protocol.ModFun
  • Network.Riak.Protocol.ResetBucketRequest
  • Network.Riak.Protocol.SearchDoc
  • Network.Riak.Protocol.SearchQueryRequest
  • Network.Riak.Protocol.SearchQueryResponse

The updated messages (as per riak's nice compatibility, they are all additions of optional fields):

  • RpbGetReq
    • optional uint32 timeout = 10;
    • optional bool sloppy_quorum = 11;
    • optional uint32 n_val = 12;
  • RpbPutReq
    • optional uint32 timeout = 12;
    • optional bool asis = 13;
    • optional bool sloppy_quorum = 14;
    • optional uint32 n_val = 15;
  • RpbDelReq
    • optional uint32 timeout = 10;
    • optional bool sloppy_quorum = 11;
    • optional uint32 n_val = 12;
  • RpbListBucketsResp
    • optional bool done = 2;
  • RpbListKeysReq
    • optional uint32 timeout = 2;
  • RpbContent
    • optional bool deleted = 11;

The updated protobufs files, riak.proto, riak_kv.proto and riak_search.proto are unchanged versions of those found in the https://github.com/basho/riak_pb repository.

Some notes on the specific changes made:

  • Regenerated code for all messages, and updated cabal file.
  • Tweaked proto.sh script to not rely on hg, this is still pretty ugly but just did enough to get it working.
  • Added exposed-modules.sh to generate list of modules for cabal file, again not pretty, but consistent with proto.sh
  • Added gitignore.
  • Update the riak client to compile with new fields.
  • Update test to abide null bucket/key constraint.

Tested with riak 1.4.1, 1.3.2 and 1.2.1.

@markhibberd markhibberd Riak 1.4 protobuf support.
 - This pulls in all new messages.
 - This includes the Search and 2i messages.
 - Regenerated code for all messages, and updated cabal file.
 - Tweaked proto.sh script to not rely on hg.
 - Added exposed-modules.sh to generate list of modules for cabal file.
 - Added gitignore.
 - Update the riak client to compile with new fields.
 - Update test to abide null bucket/key constraint.

Tested with 1.4.1, 1.3.2 and 1.2.1.
0c30ace
@markhibberd markhibberd added a commit to markhibberd/riak-haskell-client that referenced this pull request Apr 21, 2014
@markhibberd markhibberd Merge branch 'markhibberd/protobuf-upgrade' db5e927
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.