Fixup comments

This commit is contained in:
Martin Sumner 2019-11-19 16:36:57 +00:00
parent 693defb6d3
commit bcf10c9709
2 changed files with 10 additions and 3 deletions

View file

@ -151,6 +151,10 @@ to_list(Manifest) ->
-spec reader(integer(), string()) -> manifest().
%% @doc
%% Given a file path and a manifest SQN return the inker manifest
%% If the reader crashes on startup the database cannot be started. However,
%% previous versions of the manifest are kept - and so a rollback can be
%% performed. If waste is not retained though, there may be unresolvable data
%% loss on rollback.
reader(SQN, RootPath) ->
ManifestPath = leveled_inker:filepath(RootPath, manifest_dir),
leveled_log:log("I0015", [ManifestPath, SQN]),
@ -171,6 +175,9 @@ writer(Manifest, ManSQN, RootPath) ->
integer_to_list(ManSQN) ++ "." ++ ?MANIFEST_FILEX),
TmpFN = filename:join(ManPath,
integer_to_list(ManSQN) ++ "." ++ ?PENDING_FILEX),
%% TODO: This should support a CRC check, but issues with making the CRC
%% check backwards compatible (so that the reader can read manifests both
%% with and without a CRC check)
MBin = term_to_binary(to_list(Manifest), [compressed]),
leveled_log:log("I0016", [ManSQN]),
ok = leveled_util:safe_rename(TmpFN, NewFN, MBin, true),

View file

@ -323,7 +323,7 @@ ink_fold(Pid, MinSQN, FoldFuns, Acc) ->
-spec ink_loadpcl(pid(), integer(), fun(), pid()) -> ok.
%%
%% Function to prompt load of the Ledger at startup. the Penciller should
%% Function to prompt load of the Ledger at startup. The Penciller should
%% have determined the lowest SQN not present in the Ledger, and the inker
%% should fold over the Journal from that point, using the function to load
%% penciller with the results.
@ -988,7 +988,7 @@ key_check(LedgerKey, SQN, Manifest) ->
-spec build_manifest(list(), list(), #cdb_options{}) ->
{leveled_imanifest:manifest(), integer(), integer(), pid()}.
%% @doc
%% Selectes the correct manifets to open, and the starts a process for each
%% Selects the correct manifest to open, and then starts a process for each
%% file in the manifest, storing the PID for that process within the manifest.
%% Opens an active journal if one is not present.
build_manifest(ManifestFilenames,
@ -1026,7 +1026,7 @@ build_manifest(ManifestFilenames,
JSQN
end,
% Update the manifest if it has been changed by the process of laoding
% Update the manifest if it has been changed by the process of loading
% the manifest (must also increment the manifest SQN).
UpdManifestSQN =
if