janrain/riak-haskell-client — pull request #19 by markhibberd (2013-08-15 12:49:39+00:00)
Title: Riak 1.4 protobuf support.

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 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.