From 69f7e4c12a96679785eb6d65efa96ee6d76e1e39 Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Thu, 9 Nov 2017 12:48:48 +0000 Subject: [PATCH] Add doc statement --- src/leveled_iclerk.erl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/leveled_iclerk.erl b/src/leveled_iclerk.erl index 543aaee..4b808d2 100644 --- a/src/leveled_iclerk.erl +++ b/src/leveled_iclerk.erl @@ -335,6 +335,17 @@ schedule_compaction(CompactionHours, RunsPerDay, CurrentTS) -> %%%============================================================================ +%% @doc +%% Get a score for a single CDB file in the journal. This will pull out a bunch +%% of keys and sizes at random in an efficient way (by scanning the hashtable +%% then just picking the key and siz einformation of disk). +%% +%% The score should represent a percentage which is the size of the file by +%% comparison to the original file if compaction was to be run. So if a file +%% can be reduced in size by 30% the score will be 70%. +%% +%% The score is based on a random sample - so will not be consistent between +%% calls. check_single_file(CDB, FilterFun, FilterServer, MaxSQN, SampleSize, BatchSize) -> FN = leveled_cdb:cdb_filename(CDB), PositionList = leveled_cdb:cdb_getpositions(CDB, SampleSize),