Mas i449 directpromptofdeletions (#450)
* Move prompt of deletions to Inker It is a series of casts, so no reason to offload this to the clerk. Simplifies potential races in shutdown * Rename * Change cache sizes In the hope of making test more consistent
This commit is contained in:
parent
af0f2bb2cf
commit
30ec9214ac
4 changed files with 10 additions and 22 deletions
|
@ -85,7 +85,6 @@
|
|||
clerk_compact/6,
|
||||
clerk_hashtablecalc/3,
|
||||
clerk_trim/3,
|
||||
clerk_promptdeletions/3,
|
||||
clerk_stop/1,
|
||||
clerk_loglevel/2,
|
||||
clerk_addlogs/2,
|
||||
|
@ -93,11 +92,8 @@
|
|||
|
||||
-export([schedule_compaction/3]).
|
||||
|
||||
-define(JOURNAL_FILEX, "cdb").
|
||||
-define(PENDING_FILEX, "pnd").
|
||||
-define(SAMPLE_SIZE, 192).
|
||||
-define(BATCH_SIZE, 32).
|
||||
-define(BATCHES_TO_CHECK, 8).
|
||||
-define(CRC_SIZE, 4).
|
||||
-define(DEFAULT_RELOAD_STRATEGY, leveled_codec:inker_reload_strategy([])).
|
||||
-define(INTERVALS_PER_HOUR, 4).
|
||||
|
@ -188,12 +184,6 @@ clerk_compact(Pid, Checker, InitiateFun, CloseFun, FilterFun, Manifest) ->
|
|||
clerk_trim(Pid, PersistedSQN, ManifestAsList) ->
|
||||
gen_server:cast(Pid, {trim, PersistedSQN, ManifestAsList}).
|
||||
|
||||
-spec clerk_promptdeletions(pid(), pos_integer(), list()) -> ok.
|
||||
%% @doc
|
||||
%%
|
||||
clerk_promptdeletions(Pid, ManifestSQN, DeletedFiles) ->
|
||||
gen_server:cast(Pid, {prompt_deletions, ManifestSQN, DeletedFiles}).
|
||||
|
||||
-spec clerk_hashtablecalc(ets:tid(), integer(), pid()) -> ok.
|
||||
%% @doc
|
||||
%% Spawn a dedicated clerk for the process of calculating the binary view
|
||||
|
@ -419,14 +409,6 @@ handle_cast({trim, PersistedSQN, ManifestAsList}, State) ->
|
|||
leveled_log:log(ic007, []),
|
||||
ok = leveled_inker:ink_clerkcomplete(State#state.inker, [], FilesToDelete),
|
||||
{noreply, State};
|
||||
handle_cast({prompt_deletions, ManifestSQN, FilesToDelete}, State) ->
|
||||
lists:foreach(fun({_SQN, _FN, J2D, _LK}) ->
|
||||
leveled_cdb:cdb_deletepending(J2D,
|
||||
ManifestSQN,
|
||||
State#state.inker)
|
||||
end,
|
||||
FilesToDelete),
|
||||
{noreply, State};
|
||||
handle_cast({hashtable_calc, HashTree, StartPos, CDBpid}, State) ->
|
||||
{IndexList, HashTreeBin} = leveled_cdb:hashtable_calc(HashTree, StartPos),
|
||||
ok = leveled_cdb:cdb_returnhashtable(CDBpid, IndexList, HashTreeBin),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue