Allow for segment-acceleration of folds
Initially with basic tests. If the SlotIndex has been cached, we can now use the slot index as it is based on the Segment hash algortihm. This looks like it should lead to an order of magnitude improvement in querying for keys/clocks by segment ID. This also required a slight tweak to the penciller keyfolder. It now caches the next answer from the SSTiter, rather than restart the iterator. When the IMMiter has many more entries than the SSTiter (as the sSTiter is being filtered but not the IMMiter) this could lead to lots of repeated folding.
This commit is contained in:
parent
f5878548f9
commit
b141dd199c
6 changed files with 519 additions and 202 deletions
|
@ -100,8 +100,7 @@ perbucket_aae(_Config) ->
|
|||
{foldheads_allkeys,
|
||||
?RIAK_TAG,
|
||||
{get_segment_folder(DLs, TreeSize), []},
|
||||
false,
|
||||
true},
|
||||
false, true},
|
||||
|
||||
SW_SL0 = os:timestamp(),
|
||||
{async, Book2SegFolder} =
|
||||
|
@ -115,7 +114,27 @@ perbucket_aae(_Config) ->
|
|||
io:format("Segment lists found ~w ~w~n", [Book2SegList, Book3SegList]),
|
||||
|
||||
Delta = lists:subtract(Book2SegList, Book3SegList),
|
||||
true = length(Delta) == 1.
|
||||
true = length(Delta) == 1,
|
||||
|
||||
SuperHeadSegmentFolder =
|
||||
{foldheads_allkeys,
|
||||
?RIAK_TAG,
|
||||
{get_segment_folder(DLs, TreeSize), []},
|
||||
false, true, DLs},
|
||||
|
||||
SW_SL1 = os:timestamp(),
|
||||
{async, Book2SegFolder1} =
|
||||
leveled_bookie:book_returnfolder(Bookie2, SuperHeadSegmentFolder),
|
||||
{async, Book3SegFolder1} =
|
||||
leveled_bookie:book_returnfolder(Bookie3, SuperHeadSegmentFolder),
|
||||
Book2SegList1 = Book2SegFolder1(),
|
||||
Book3SegList1 = Book3SegFolder1(),
|
||||
Time_SL1 = timer:now_diff(os:timestamp(), SW_SL1)/1000,
|
||||
io:format("Two segment list folds took ~w milliseconds ~n", [Time_SL1]),
|
||||
io:format("Segment lists found ~w ~w~n", [Book2SegList1, Book3SegList1]),
|
||||
|
||||
Delta1 = lists:subtract(Book2SegList1, Book3SegList1),
|
||||
true = length(Delta1) == 1.
|
||||
|
||||
|
||||
get_segment_folder(SegmentList, TreeSize) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue