Add support for buckets that are tuples
Only {binary(), binary()} tuples
This commit is contained in:
parent
cbd7713c71
commit
0fb35e658f
3 changed files with 23 additions and 6 deletions
|
@ -181,7 +181,7 @@
|
|||
-type head_timings() :: no_timing|#head_timings{}.
|
||||
-type timing_types() :: head|get|put|fold.
|
||||
-type recent_aae() :: false|#recent_aae{}|undefined.
|
||||
-type key() :: binary()|string().
|
||||
-type key() :: binary()|string()|{binary(), binary()}.
|
||||
% Keys SHOULD be binary()
|
||||
% string() support is a legacy of old tests
|
||||
-type open_options() ::
|
||||
|
|
|
@ -843,7 +843,9 @@ get_metadata_from_siblings(<<ValLen:32/integer, Rest0/binary>>,
|
|||
next_key(Key) when is_binary(Key) ->
|
||||
<<Key/binary, 0>>;
|
||||
next_key(Key) when is_list(Key) ->
|
||||
Key ++ [0].
|
||||
Key ++ [0];
|
||||
next_key({Type, Bucket}) when is_binary(Type), is_binary(Bucket) ->
|
||||
{Type, next_key(Bucket)}.
|
||||
|
||||
|
||||
%%%============================================================================
|
||||
|
|
|
@ -500,7 +500,7 @@ multibucket_fold(_Config) ->
|
|||
[],
|
||||
ObjectGen,
|
||||
IndexGen,
|
||||
<<"Bucket1">>),
|
||||
{<<"Type1">>, <<"Bucket1">>}),
|
||||
testutil:riakload(Bookie1, ObjL1),
|
||||
ObjL2 = testutil:generate_objects(17000,
|
||||
uuid,
|
||||
|
@ -521,7 +521,7 @@ multibucket_fold(_Config) ->
|
|||
[],
|
||||
ObjectGen,
|
||||
IndexGen,
|
||||
<<"Bucket4">>),
|
||||
{<<"Type2">>, <<"Bucket4">>}),
|
||||
testutil:riakload(Bookie1, ObjL4),
|
||||
|
||||
FF = fun(B, K, _PO, Acc) ->
|
||||
|
@ -531,7 +531,9 @@ multibucket_fold(_Config) ->
|
|||
|
||||
{async, R1} = leveled_bookie:book_headfold(Bookie1,
|
||||
?RIAK_TAG,
|
||||
{bucket_list, [<<"Bucket1">>, <<"Bucket4">>]},
|
||||
{bucket_list,
|
||||
[{<<"Type1">>, <<"Bucket1">>},
|
||||
{<<"Type2">>, <<"Bucket4">>}]},
|
||||
FoldAccT,
|
||||
false,
|
||||
true,
|
||||
|
@ -556,7 +558,20 @@ multibucket_fold(_Config) ->
|
|||
|
||||
true = 36000 == O1,
|
||||
true = 24000 == O2,
|
||||
|
||||
|
||||
FoldBucketsFun = fun(B, Acc) -> [B|Acc] end,
|
||||
{async, Folder} =
|
||||
leveled_bookie:book_bucketlist(Bookie1,
|
||||
?RIAK_TAG,
|
||||
{FoldBucketsFun, []},
|
||||
all),
|
||||
BucketList = Folder(),
|
||||
ExpectedBucketList =
|
||||
[{<<"Type1">>, <<"Bucket1">>}, {<<"Type2">>, <<"Bucket4">>},
|
||||
<<"Bucket2">>, <<"Bucket3">>],
|
||||
io:format("BucketList ~w", [BucketList]),
|
||||
true = ExpectedBucketList == BucketList,
|
||||
|
||||
ok = leveled_bookie:book_close(Bookie1),
|
||||
testutil:reset_filestructure().
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue