Feature/ bag support #76

Merged
merged 5 commits into from May 30, 2014

Projects

None yet

2 participants

@shino
Contributor
shino commented Feb 26, 2014
This was referenced Feb 26, 2014
@kuenishi kuenishi commented on an outdated diff Mar 25, 2014
src/stanchion_utils.erl
@@ -64,6 +64,8 @@
-define(BLOCK_BUCKET_PREFIX, <<"0b:">>). % Version # = 0
-type bucket_op() :: create | update_acl | delete | update_policy | delete_policy.
+-type bucket_op_opts() :: [bucket_op_opt()].
+-type bucket_op_opt() :: {acl, acl()} | {policy, binary()} | delete_policy.
kuenishi
kuenishi Mar 25, 2014 Contributor

add {bag, binary()} here?

@kuenishi kuenishi commented on an outdated diff Mar 25, 2014
src/stanchion_utils.erl
UpdBucketObj = riakc_obj:update_metadata(UpdBucketObj0, MetaData),
riakc_pb_socket:put(RiakPid, UpdBucketObj, PutOptions).
-make_new_metadata(MD, UserMeta) ->
- dict:store(?MD_USERMETA, UserMeta, dict:erase(?MD_USERMETA, MD)).
-
-make_new_user_metadata(MetaVals, {acl, Acl})->
- [{?MD_ACL, term_to_binary(Acl)} | proplists:delete(?MD_ACL, MetaVals)];
-make_new_user_metadata(MetaVals, {policy, Policy}) ->
- [{?MD_POLICY, term_to_binary(Policy)} |
- proplists:delete(?MD_POLICY, MetaVals)];
-make_new_user_metadata(MetaVals, delete_policy) ->
- proplists:delete(?MD_POLICY, MetaVals).
+make_new_metadata(MD, Opts) ->
kuenishi
kuenishi Mar 25, 2014 Contributor

is this spec -spec make_new_matadata(proplists:proplist(), bucket_op_opts()) -> proplists:proplist() ?

@kuenishi kuenishi commented on an outdated diff Mar 25, 2014
src/stanchion_utils.erl
-make_new_metadata(MD, UserMeta) ->
- dict:store(?MD_USERMETA, UserMeta, dict:erase(?MD_USERMETA, MD)).
-
-make_new_user_metadata(MetaVals, {acl, Acl})->
- [{?MD_ACL, term_to_binary(Acl)} | proplists:delete(?MD_ACL, MetaVals)];
-make_new_user_metadata(MetaVals, {policy, Policy}) ->
- [{?MD_POLICY, term_to_binary(Policy)} |
- proplists:delete(?MD_POLICY, MetaVals)];
-make_new_user_metadata(MetaVals, delete_policy) ->
- proplists:delete(?MD_POLICY, MetaVals).
+make_new_metadata(MD, Opts) ->
+ MetaVals = dict:fetch(?MD_USERMETA, MD),
+ UserMetaData = make_new_user_metadata(MetaVals, Opts),
+ dict:store(?MD_USERMETA, UserMetaData, dict:erase(?MD_USERMETA, MD)).
+
+make_new_user_metadata(MetaVals, [])->
kuenishi
kuenishi Mar 25, 2014 Contributor

is this also, -spec make_new_user_metadata(proplists:proplist(), bucket_op_opts()) -> proplists:proplist(). ? maybe proplists could be replaced with more precise name.

Contributor

About name -type bucket_op_opt() :: {acl, acl()} | {policy, binary()} | delete_policy. , it sounds like detailed operations, rather than options.

@kuenishi kuenishi self-assigned this Mar 25, 2014
@shino shino changed the title from Multi-cluster support to Feature/ bag support May 20, 2014
@shino shino changed the title from Feature/ bag support to Feature/ multi cluster support May 20, 2014
@shino shino changed the title from Feature/ multi cluster support to Feature/ multibag May 20, 2014
@shino shino changed the title from Feature/ multibag to Feature/ bag support May 20, 2014
@shino shino added this to the 1.5.0 milestone May 28, 2014
Contributor

+1

@shino shino merged commit bc4ad0f into develop May 30, 2014
@shino shino deleted the feature/multi-cluster-support branch May 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment