From 30ad1f0794f887ac1c28ac9209895ae83cfb2dc8 Mon Sep 17 00:00:00 2001 From: Kresten Krab Thorup Date: Thu, 19 Jan 2012 15:19:22 +0100 Subject: [PATCH] Use ?TOMBSTONE macro everywhere --- src/lsm_btree_merger2.erl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lsm_btree_merger2.erl b/src/lsm_btree_merger2.erl index ca393da..c883717 100644 --- a/src/lsm_btree_merger2.erl +++ b/src/lsm_btree_merger2.erl @@ -6,6 +6,13 @@ -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). merge(A,B,C, Size, IsLastLevel) -> @@ -73,7 +80,7 @@ scan(BT1, BT2, Out, IsLastLevel, [{Key1,Value1}|AT]=AKVs, [{Key2,Value2}|BT]=BKV end, 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); true -> @@ -94,7 +101,7 @@ scan_only(BT, Out, IsLastLevel, [], Count) -> {ok, Count, Out} 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, IsLastLevel, [{Key,Value}|Rest], Count) ->