Use ?TOMBSTONE macro everywhere
This commit is contained in:
parent
f56f530d7a
commit
30ad1f0794
1 changed files with 9 additions and 2 deletions
|
@ -6,6 +6,13 @@
|
||||||
|
|
||||||
-export([merge/5]).
|
-export([merge/5]).
|
||||||
|
|
||||||
|
-include("lsm_btree.hrl").
|
||||||
|
|
||||||
|
%%
|
||||||
|
%% Most likely, there will be plenty of I/O being generated by
|
||||||
|
%% concurrent merges, so we default to running the entire merge
|
||||||
|
%% in one process.
|
||||||
|
%%
|
||||||
-define(LOCAL_WRITER, true).
|
-define(LOCAL_WRITER, true).
|
||||||
|
|
||||||
merge(A,B,C, Size, IsLastLevel) ->
|
merge(A,B,C, Size, IsLastLevel) ->
|
||||||
|
@ -73,7 +80,7 @@ scan(BT1, BT2, Out, IsLastLevel, [{Key1,Value1}|AT]=AKVs, [{Key2,Value2}|BT]=BKV
|
||||||
end,
|
end,
|
||||||
scan(BT1, BT2, Out2, IsLastLevel, AKVs, BT, Count+1);
|
scan(BT1, BT2, Out2, IsLastLevel, AKVs, BT, Count+1);
|
||||||
|
|
||||||
(delete =:= Value2) and (true =:= IsLastLevel) ->
|
(?TOMBSTONE =:= Value2) and (true =:= IsLastLevel) ->
|
||||||
scan(BT1, BT2, Out, IsLastLevel, AT, BT, Count);
|
scan(BT1, BT2, Out, IsLastLevel, AT, BT, Count);
|
||||||
|
|
||||||
true ->
|
true ->
|
||||||
|
@ -94,7 +101,7 @@ scan_only(BT, Out, IsLastLevel, [], Count) ->
|
||||||
{ok, Count, Out}
|
{ok, Count, Out}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
scan_only(BT, Out, true, [{_,delete}|Rest], Count) ->
|
scan_only(BT, Out, true, [{_,?TOMBSTONE}|Rest], Count) ->
|
||||||
scan_only(BT, Out, true, Rest, Count);
|
scan_only(BT, Out, true, Rest, Count);
|
||||||
|
|
||||||
scan_only(BT, Out, IsLastLevel, [{Key,Value}|Rest], Count) ->
|
scan_only(BT, Out, IsLastLevel, [{Key,Value}|Rest], Count) ->
|
||||||
|
|
Loading…
Reference in a new issue