Add new backend capability for Riak r_object use #552

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

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
a23dec8
Contributor

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

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 May 16, 2013

Contributor

what this define is used for?

@slfritchie

slfritchie May 17, 2013

Contributor

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

@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 May 16, 2013

Contributor

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

src/riak_kv_vnode.erl
end.
+mod_capability_uses_r_object(Mod, ModState, Bucket) ->
@jrwest

jrwest May 16, 2013

Contributor

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

Contributor

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
Contributor

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