Provide a top level API for folds
As the fold functions have been added to get_runner in an ad hoc way, naturally, given the ongoing development of levelEd to support Riak, it was difficult for a new user (in this case Quviq) to see what folds are supported, and with what arguments, and expectations. This PR is for discussion. It is one of many ways to group, spec, and document the fold functions. A test is also added for coverage of range queries.
This commit is contained in:
parent
a1269e5274
commit
b7bd65d11f
6 changed files with 448 additions and 101 deletions
|
@ -147,14 +147,16 @@ many_put_compare(_Config) ->
|
|||
leveled_tictac:add_kv(Acc, Key, Value, ExtractClockFun)
|
||||
end,
|
||||
|
||||
FoldQ0 = {foldheads_bybucket,
|
||||
o_rkv,
|
||||
"Bucket",
|
||||
all,
|
||||
{FoldObjectsFun, leveled_tictac:new_tree(0, TreeSize)},
|
||||
false, true, false},
|
||||
FoldAccT = {FoldObjectsFun, leveled_tictac:new_tree(0, TreeSize)},
|
||||
{async, TreeAObjFolder0} =
|
||||
leveled_bookie:book_returnfolder(Bookie2, FoldQ0),
|
||||
leveled_bookie:book_headfold(Bookie2,
|
||||
o_rkv,
|
||||
{range, "Bucket", all},
|
||||
FoldAccT,
|
||||
false,
|
||||
true,
|
||||
false),
|
||||
|
||||
SWB0Obj = os:timestamp(),
|
||||
TreeAObj0 = TreeAObjFolder0(),
|
||||
io:format("Build tictac tree via object fold with no "++
|
||||
|
@ -1338,4 +1340,4 @@ get_segment(K, SegmentCount) ->
|
|||
end,
|
||||
{SegmentID, ExtraHash} = leveled_codec:segment_hash(BinKey),
|
||||
SegHash = (ExtraHash band 65535) bsl 16 + SegmentID,
|
||||
leveled_tictac:get_segment(SegHash, SegmentCount).
|
||||
leveled_tictac:get_segment(SegHash, SegmentCount).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue