Do incremental merge before inject

This commit is contained in:
Kresten Krab Thorup 2012-04-26 00:51:04 +02:00
parent d58ab9ea32
commit 085f400bb8

View file

@ -181,13 +181,15 @@ finish(#nursery{ dir=Dir, cache=Cache, log_file=LogFile,
% error_logger:info_msg("dumping log (count=~p, size=~p, outsize=~p)~n", % error_logger:info_msg("dumping log (count=~p, size=~p, outsize=~p)~n",
% [ gb_trees:size(Cache), TotalSize, FileInfo#file_info.size ]), % [ gb_trees:size(Cache), TotalSize, FileInfo#file_info.size ]),
%% inject the B-Tree (blocking RPC)
ok = hanoi_level:inject(TopLevel, BTreeFileName),
%% issue some work if this is a top-level inject (blocks until previous such %% issue some work if this is a top-level inject (blocks until previous such
%% incremental merge is finished). %% incremental merge is finished).
hanoi_level:incremental_merge(TopLevel, hanoi_level:incremental_merge(TopLevel,
(MaxLevel-?TOP_LEVEL+1)*?BTREE_SIZE(?TOP_LEVEL)), (MaxLevel-?TOP_LEVEL+1)*?BTREE_SIZE(?TOP_LEVEL)),
%% inject the B-Tree (blocking RPC)
ok = hanoi_level:inject(TopLevel, BTreeFileName),
ok; ok;
_ -> _ ->