Skip to content

Add new backend capability for Riak r_object use #552

Closed
wants to merge 3 commits into from

3 participants

@slfritchie

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.

@slfritchie

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

@slfritchie slfritchie was assigned May 16, 2013
@jrwest jrwest commented on the diff May 16, 2013
rebar.config
@@ -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},
+ {d, 'TEST_FS2_BACKEND_IN_RIAK_KV'}]}.
@jrwest
jrwest added a note May 16, 2013

what this define is used for?

@slfritchie
slfritchie added a note May 17, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jrwest jrwest commented on an outdated diff May 16, 2013
src/riak_kv_vnode.erl
@@ -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
jrwest added a note 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jrwest jrwest commented on an outdated diff May 16, 2013
src/riak_kv_vnode.erl
end.
+mod_capability_uses_r_object(Mod, ModState, Bucket) ->
@jrwest
jrwest added a note May 16, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jrwest
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

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

@slfritchie slfritchie closed this May 17, 2013
@seancribbs seancribbs was assigned May 29, 2013
@seancribbs seancribbs deleted the slf-backend-capability-enc+no_get branch Apr 1, 2015
@seancribbs 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
Something went wrong with that request. Please try again.