Skip to content

Commit

Permalink
Schema clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsumner committed Dec 9, 2020
1 parent 186e386 commit 182395e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
16 changes: 10 additions & 6 deletions priv/leveled.schema
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
%% @doc Strategy for flushing data to disk
%% Can be set to riak_sync, sync (if OTP > 16) or none. Use none, and the OS
%% will flush when most efficient. Use riak_sync or sync to flush after every
%% PUT (not recommended wihtout some hardware support e.g. flash drives and/or
%% PUT (not recommended without some hardware support e.g. flash drives and/or
%% Flash-backed Write Caches)
{mapping, "leveled.sync_strategy", "leveled.sync_strategy", [
{default, none},
Expand Down Expand Up @@ -100,9 +100,11 @@
{datatype, integer}
]}.

%% @doc The number of times per day to score an individual file for compaction
%% @doc The number of times per day to score an individual file for compaction.
%% The default value will lead to each file, on average, being scored once
%% every 8 hours
{mapping, "leveled.compaction_scores_perday", "leveled.compaction_scores_perday", [
{default, 1},
{default, 3},
{datatype, integer}
]}.

Expand All @@ -126,7 +128,9 @@

%% @doc Max Journal Files Per Compaction Run
%% In a single compaction run, what is the maximum number of consecutive files
%% which may be compacted.
%% which may be compacted. If increasing this value, the average number of
%% files per run may decrease, unless adjustments are also made to the
%% maxrunlength and singlefile compactionpercentage settings.
{mapping, "leveled.max_run_length", "leveled.max_run_length", [
{default, 4},
{datatype, integer}
Expand All @@ -146,10 +150,10 @@
%% @doc Target Percentage for Single File
%% What is the target score for a run of a single file, to qualify for
%% compaction. If less than this percentage would be retained after compaction
%% then it is a candidate (e.g. in default case if 70% of space would be
%% then it is a candidate (e.g. in default case if 75% of space would be
%% recovered)
{mapping, "leveled.singlefile_compactionpercentage", "leveled.singlefile_compactionpercentage", [
{default, 30.0},
{default, 25.0},
{datatype, float},
hidden
]}.
Expand Down
22 changes: 16 additions & 6 deletions priv/leveled_multi.schema
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
%% @doc Strategy for flushing data to disk
%% Can be set to riak_sync, sync (if OTP > 16) or none. Use none, and the OS
%% will flush when most efficient. Use riak_sync or sync to flush after every
%% PUT (not recommended wihtout some hardware support e.g. flash drives and/or
%% PUT (not recommended without some hardware support e.g. flash drives and/or
%% Flash-backed Write Caches)
{mapping, "multi_backend.$name.leveled.sync_strategy", "riak_kv.multi_backend", [
{default, none},
Expand Down Expand Up @@ -91,11 +91,19 @@
%% The higher the value, the more compaction runs, and the sooner space is
%% recovered. But each run has a cost
{mapping, "multi_backend.$name.leveled.compaction_runs_perday", "riak_kv.multi_backend", [
{default, 16},
{default, 24},
{datatype, integer},
hidden
]}.

%% @doc The number of times per day to score an individual file for compaction
%% The default value will lead to each file, on average, being scored once
%% every 8 hours
{mapping, "multi_backend.$name.leveled.compaction_scores_perday", "riak_kv.multi_backend", [
{default, 3},
{datatype, integer}
]}.

%% @doc Compaction Low Hour
%% The hour of the day in which journal compaction can start. Use Low hour
%% of 0 and High hour of 23 to have no compaction window (i.e. always compact
Expand All @@ -118,9 +126,11 @@

%% @doc Max Journal Files Per Compaction Run
%% In a single compaction run, what is the maximum number of consecutive files
%% which may be compacted.
%% which may be compacted. If increasing this value, the average number of
%% files per run may decrease, unless adjustments are also made to the
%% maxrunlength and singlefile compactionpercentage settings.
{mapping, "multi_backend.$name.leveled.max_run_length", "riak_kv.multi_backend", [
{default, 6},
{default, 4},
{datatype, integer},
hidden
]}.
Expand All @@ -139,10 +149,10 @@
%% @doc Target Percentage for Single File
%% What is the target score for a run of a single file, to qualify for
%% compaction. If less than this percentage would be retained after compaction
%% then it is a candidate (e.g. in default case if 50% of space would be
%% then it is a candidate (e.g. in default case if 25% of space would be
%% recovered)
{mapping, "multi_backend.$name.leveled.singlefile_compactionpercentage", "riak_kv.multi_backend", [
{default, 50.0},
{default, 25.0},
{datatype, float},
hidden
]}.
Expand Down

0 comments on commit 182395e

Please sign in to comment.