Add new backend capability for Riak r_object use #552

wants to merge 3 commits into


None yet
3 participants

slfritchie commented May 15, 2013

Add the optional riak_kv backend capability to pass Riak r_object records to/from the backend rather than binary blobs that are serialized/unserialized by riak_kv_vnode.

Also, rearrange the QuickCheck tests to permit easier testing of the fs2 backend.

Scott Lystig Fritchie added some commits May 4, 2013

Scott Lystig Fritchie Intermediate refactoring: isolate Mod:put() and Mod:get() 44167e7
Scott Lystig Fritchie QuickCheck-related changes for fs2 backend
Also, add backend-specific bucket & key name generators and
fix type spec typo

slfritchie commented May 15, 2013

NOTE: Branches are apparently hard. This should be merged to master, not the base branch that GitHub is thinking of.

slfritchie was assigned May 16, 2013

@jrwest jrwest commented on the diff May 16, 2013

@@ -1,6 +1,8 @@
{cover_enabled, true}.
{edoc_opts, [{preprocess, true}]}.
-{erl_opts, [warnings_as_errors, {parse_transform, lager_transform}]}.
+{erl_opts, [warnings_as_errors,
+ {parse_transform, lager_transform},

jrwest May 16, 2013


what this define is used for?


slfritchie May 17, 2013


For testing riak_kv_fs2_backend.erl, which is in the CS repo.

@jrwest jrwest commented on an outdated diff May 16, 2013

@@ -1526,14 +1541,25 @@ object_info({Bucket, _Key}=BKey) ->
Hash = riak_core_util:chash_key(BKey),
{Bucket, Hash}.
-object_from_binary({B,K}, ValBin) ->
- object_from_binary(B, K, ValBin).
-object_from_binary(B, K, ValBin) ->
- case riak_object:from_binary(B, K, ValBin) of
- {error, R} -> throw(R);
- Obj -> Obj
+-spec encode_and_Mod_put(

jrwest May 16, 2013


imo this should be named encode_and_put to be consistent w/ do_get_object which also takes a Mod. Also, personally not a fan of capital letters in fn names.

@jrwest jrwest commented on an outdated diff May 16, 2013

+mod_capability_uses_r_object(Mod, ModState, Bucket) ->

jrwest May 16, 2013


ELONGFUNNAME ;). maybe shorten a bit: uses_r_obj(ect)?


jrwest commented May 16, 2013

backend_eqc still passes (using mem. backend) with changes. ran a few riak tests (like verify_riak_object_reformat and mapred_rt_verify) against it and all passed. Changes seem fine. Would like to see couple of style comments I left addressed but other than that +1.

EDIT: any reason to not re-submit this PR against master?

@slfritchie slfritchie pushed a commit that referenced this pull request May 17, 2013

Scott Lystig Fritchie Merge pull request #552 from basho/slf-backend-capability-enc+no_get 146e3ca

slfritchie commented May 17, 2013

Closing with commit 146e3ca (the result of a merge conflict, which I fixed, EUnit tests passing)

slfritchie closed this May 17, 2013

seancribbs was assigned May 29, 2013

seancribbs deleted the slf-backend-capability-enc+no_get branch Apr 1, 2015

seancribbs removed their assignment May 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment