Merge pull request #191 from martinsumner/mas-i189-tuplebuckets
Mas i189 tuplebuckets
This commit is contained in:
commit
8be873f776
3 changed files with 23 additions and 6 deletions
|
@ -182,7 +182,7 @@
|
||||||
-type head_timings() :: no_timing|#head_timings{}.
|
-type head_timings() :: no_timing|#head_timings{}.
|
||||||
-type timing_types() :: head|get|put|fold.
|
-type timing_types() :: head|get|put|fold.
|
||||||
-type recent_aae() :: false|#recent_aae{}|undefined.
|
-type recent_aae() :: false|#recent_aae{}|undefined.
|
||||||
-type key() :: binary()|string().
|
-type key() :: binary()|string()|{binary(), binary()}.
|
||||||
% Keys SHOULD be binary()
|
% Keys SHOULD be binary()
|
||||||
% string() support is a legacy of old tests
|
% string() support is a legacy of old tests
|
||||||
-type open_options() ::
|
-type open_options() ::
|
||||||
|
|
|
@ -843,7 +843,9 @@ get_metadata_from_siblings(<<ValLen:32/integer, Rest0/binary>>,
|
||||||
next_key(Key) when is_binary(Key) ->
|
next_key(Key) when is_binary(Key) ->
|
||||||
<<Key/binary, 0>>;
|
<<Key/binary, 0>>;
|
||||||
next_key(Key) when is_list(Key) ->
|
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,
|
ObjectGen,
|
||||||
IndexGen,
|
IndexGen,
|
||||||
<<"Bucket1">>),
|
{<<"Type1">>, <<"Bucket1">>}),
|
||||||
testutil:riakload(Bookie1, ObjL1),
|
testutil:riakload(Bookie1, ObjL1),
|
||||||
ObjL2 = testutil:generate_objects(17000,
|
ObjL2 = testutil:generate_objects(17000,
|
||||||
uuid,
|
uuid,
|
||||||
|
@ -521,7 +521,7 @@ multibucket_fold(_Config) ->
|
||||||
[],
|
[],
|
||||||
ObjectGen,
|
ObjectGen,
|
||||||
IndexGen,
|
IndexGen,
|
||||||
<<"Bucket4">>),
|
{<<"Type2">>, <<"Bucket4">>}),
|
||||||
testutil:riakload(Bookie1, ObjL4),
|
testutil:riakload(Bookie1, ObjL4),
|
||||||
|
|
||||||
FF = fun(B, K, _PO, Acc) ->
|
FF = fun(B, K, _PO, Acc) ->
|
||||||
|
@ -531,7 +531,9 @@ multibucket_fold(_Config) ->
|
||||||
|
|
||||||
{async, R1} = leveled_bookie:book_headfold(Bookie1,
|
{async, R1} = leveled_bookie:book_headfold(Bookie1,
|
||||||
?RIAK_TAG,
|
?RIAK_TAG,
|
||||||
{bucket_list, [<<"Bucket1">>, <<"Bucket4">>]},
|
{bucket_list,
|
||||||
|
[{<<"Type1">>, <<"Bucket1">>},
|
||||||
|
{<<"Type2">>, <<"Bucket4">>}]},
|
||||||
FoldAccT,
|
FoldAccT,
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
|
@ -556,7 +558,20 @@ multibucket_fold(_Config) ->
|
||||||
|
|
||||||
true = 36000 == O1,
|
true = 36000 == O1,
|
||||||
true = 24000 == O2,
|
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),
|
ok = leveled_bookie:book_close(Bookie1),
|
||||||
testutil:reset_filestructure().
|
testutil:reset_filestructure().
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue