Skip to content

Commit

Permalink
Move list of bucket type properties to hash for riak_object metadata …
Browse files Browse the repository at this point in the history
…into riak_object module and update the function calls to property_hash appropriately.
  • Loading branch information
kellymclaughlin committed Feb 13, 2014
1 parent f978940 commit 50321a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/riak_object.erl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
%% Shanley's(11) + Joe's(42)
-define(EMPTY_VTAG_BIN, <<"e">>).

-define(DEFAULT_HASH_BUCKET_PROPS, [consistent, datatype, n_val, allow_mult, last_write_wins]).

-export([new/3, new/4, ensure_robject/1, ancestors/1, reconcile/2, equal/2]).
-export([increment_vclock/2, increment_vclock/3]).
-export([key/1, get_metadata/1, get_metadatas/1, get_values/1, get_value/1]).
Expand Down Expand Up @@ -511,7 +513,7 @@ apply_updates(Object=#r_object{}) ->
calculate_bucket_type_hash(undefined) ->
undefined;
calculate_bucket_type_hash(Type) ->
riak_core_bucket_type:property_hash(Type).
riak_core_bucket_type:property_hash(Type, ?DEFAULT_HASH_BUCKET_PROPS).

-spec maybe_add_bucket_type_hash(dict(), undefined | integer()) -> dict().
maybe_add_bucket_type_hash(MD, undefined) ->
Expand Down Expand Up @@ -1126,7 +1128,7 @@ object_test_setup() ->
riak_object:update_value(O1, V2)),
Actor),
meck:new(riak_core_bucket_type, [passthrough]),
meck:expect(riak_core_bucket_type, property_hash, fun(_) -> 12345 end),
meck:expect(riak_core_bucket_type, property_hash, fun(_, _) -> 12345 end),
TypeO2 = riak_object:increment_vclock(
riak_object:apply_updates(
riak_object:update_value(TypeO1, V2)),
Expand Down

0 comments on commit 50321a6

Please sign in to comment.