Change FoldBucketsFun to take just bucket

FoldBucketsFun does not take keys should be a 2-arity function (Bucket,
Acc).
This commit is contained in:
martinsumner 2016-11-21 14:12:17 +00:00
parent acdc702e7d
commit 51dbad95c0
2 changed files with 4 additions and 4 deletions

View file

@ -448,7 +448,7 @@ bucket_stats(State, Bucket, Tag) ->
{async, Folder}. {async, Folder}.
binary_bucketlist(State, Tag, {FoldKeysFun, InitAcc}) -> binary_bucketlist(State, Tag, {FoldBucketsFun, InitAcc}) ->
% List buckets for tag, assuming bucket names are all binary type % List buckets for tag, assuming bucket names are all binary type
{ok, {ok,
{LedgerSnapshot, LedgerCache}, {LedgerSnapshot, LedgerCache},
@ -462,7 +462,7 @@ binary_bucketlist(State, Tag, {FoldKeysFun, InitAcc}) ->
LedgerSnapshot, LedgerSnapshot,
[]), []),
ok = leveled_penciller:pcl_close(LedgerSnapshot), ok = leveled_penciller:pcl_close(LedgerSnapshot),
lists:foldl(fun({B, K}, Acc) -> FoldKeysFun(B, K, Acc) end, lists:foldl(fun({B, _K}, Acc) -> FoldBucketsFun(B, Acc) end,
InitAcc, InitAcc,
BucketAcc) BucketAcc)
end, end,

View file

@ -113,7 +113,7 @@ small_load_with2i(_Config) ->
Total2 = Sum2(), Total2 = Sum2(),
true = Total2 == Total1, true = Total2 == Total1,
FoldBucketsFun = fun(B, _K, Acc) -> sets:add_element(B, Acc) end, FoldBucketsFun = fun(B, Acc) -> sets:add_element(B, Acc) end,
% Should not find any buckets - as there is a non-binary bucket, and no % Should not find any buckets - as there is a non-binary bucket, and no
% binary ones % binary ones
BucketListQuery = {binary_bucketlist, BucketListQuery = {binary_bucketlist,
@ -322,7 +322,7 @@ query_count(_Config) ->
R9), R9),
testutil:check_forobject(Book4, TestObject), testutil:check_forobject(Book4, TestObject),
FoldBucketsFun = fun(B, _K, Acc) -> sets:add_element(B, Acc) end, FoldBucketsFun = fun(B, Acc) -> sets:add_element(B, Acc) end,
BucketListQuery = {binary_bucketlist, BucketListQuery = {binary_bucketlist,
?RIAK_TAG, ?RIAK_TAG,
{FoldBucketsFun, sets:new()}}, {FoldBucketsFun, sets:new()}},