Permalink
Browse files

Cuttlefish schema RHS sub for platform bin_dir

also, rearranged mappings so multi versions are right near their bitcask counterparts
  • Loading branch information...
1 parent d187158 commit b6dfd126e69916a50b80d03dba6a85f023be089b Joe DeVivo committed Feb 11, 2014
Showing with 139 additions and 133 deletions.
  1. +125 −130 priv/bitcask.schema
  2. +14 −3 test/bitcask_schema_tests.erl
View
@@ -4,7 +4,13 @@
%% @doc A path under which bitcask data files will be stored.
{mapping, "bitcask.data_root", "bitcask.data_root", [
- {default, "{{platform_data_dir}}/bitcask"},
+ {default, "#(platform_data_dir)/bitcask"},
+ {datatype, directory}
+]}.
+
+%% @see bitcask.data_root
+{mapping, "multi_backend.$name.bitcask.data_root", "riak_kv.multi_backend", [
+ {level, advanced},
{datatype, directory}
]}.
@@ -20,6 +26,13 @@
{level, advanced}
]}.
+%% @see bitcask.open_timeout
+{mapping, "multi_backend.$name.bitcask.open_timeout", "riak_kv.multi_backend", [
+ {default, "4s"},
+ {datatype, {duration, s}},
+ {level, advanced}
+]}.
+
%% @doc Changes the durability of writes by specifying when to
%% synchronize data to disk. The default setting protects against data
%% loss in the event of application failure (process death) but leaves
@@ -53,11 +66,24 @@
]}.
%% @see bitcask.sync.strategy
+{mapping, "multi_backend.$name.bitcask.sync.strategy", "riak_kv.multi_backend", [
+ {default, none},
+ {datatype, {enum, [none, o_sync, interval]}},
+ {level, advanced}
+]}.
+
+%% @see bitcask.sync.strategy
{mapping, "bitcask.sync.interval", "bitcask.sync_strategy", [
{datatype, {duration, s}},
{level, advanced}
]}.
+%% @see bitcask.sync.strategy
+{mapping, "multi_backend.$name.bitcask.sync.interval", "riak_kv.multi_backend", [
+ {datatype, {duration, s}},
+ {level, advanced}
+]}.
+
{translation,
"bitcask.sync_strategy",
fun(Conf) ->
@@ -82,6 +108,12 @@
{level, advanced}
]}.
+%% @see bitcask.max_file_size
+{mapping, "multi_backend.$name.bitcask.max_file_size", "riak_kv.multi_backend", [
+ {default, "2GB"},
+ {datatype, bytesize},
+ {level, advanced}
+]}.
%% @doc Lets you specify when during the day merge operations are
%% allowed to be triggered. Valid options are:
@@ -102,19 +134,39 @@
]}.
%% @see bitcask.merge.policy
+{mapping, "multi_backend.$name.bitcask.merge.policy", "riak_kv.multi_backend", [
+ {default, always},
+ {datatype, {enum, [always, never, window]}},
+ {level, advanced}
+]}.
+
+%% @see bitcask.merge.policy
{mapping, "bitcask.merge.window.start", "bitcask.merge_window", [
{default, 0},
{datatype, integer},
{level, advanced}
]}.
%% @see bitcask.merge.policy
+{mapping, "multi_backend.$name.bitcask.merge.window.start", "riak_kv.multi_backend", [
+ {default, 0},
+ {datatype, integer},
+ {level, advanced}
+]}.
+
+%% @see bitcask.merge.policy
{mapping, "bitcask.merge.window.end", "bitcask.merge_window", [
{default, 23},
{datatype, integer},
{level, advanced}
]}.
+%% @see bitcask.merge.policy
+{mapping, "multi_backend.$name.bitcask.merge.window.end", "riak_kv.multi_backend", [
+ {default, 23},
+ {datatype, integer},
+ {level, advanced}
+]}.
{translation,
"bitcask.merge_window",
@@ -149,6 +201,14 @@
{validators, ["is_percentage"]}
]}.
+%% @see bitcask.merge.triggers.fragmentation
+{mapping, "multi_backend.$name.bitcask.merge.triggers.fragmentation", "riak_kv.multi_backend", [
+ {datatype, integer},
+ {level, advanced},
+ {default, 60},
+ {validators, ["is_percentage"]}
+]}.
+
{validator,
"is_percentage",
"must be a percentage",
@@ -175,6 +235,13 @@
{default, "512MB"}
]}.
+%% @see bitcask.merge.triggers.dead_bytes
+{mapping, "multi_backend.$name.bitcask.merge.triggers.dead_bytes", "riak_kv.multi_backend", [
+ {datatype, bytesize},
+ {level, advanced},
+ {default, "512MB"}
+]}.
+
%% @doc Describes what ratio of dead keys to total keys in a file will
%% cause it to be included in the merge. The value of this setting is
%% a percentage (0-100). For example, if a data file contains 4 dead
@@ -192,6 +259,14 @@
{validators, ["is_percentage"]}
]}.
+%% @see bitcask.merge.thresholds.fragmentation
+{mapping, "multi_backend.$name.bitcask.thresholds.fragmentation", "riak_kv.multi_backend", [
+ {datatype, integer},
+ {level, advanced},
+ {default, 40},
+ {validators, ["is_percentage"]}
+]}.
+
%% @doc Describes the minimum amount of data occupied by dead keys in
%% a file to cause it to be included in the merge. Increasing the
%% value will cause fewer files to be merged, decreasing the value
@@ -205,6 +280,13 @@
{default, "128MB"}
]}.
+%% @see bitcask.merge.thresholds.dead_bytes
+{mapping, "multi_backend.$name.bitcask.thresholds.dead_bytes", "riak_kv.multi_backend", [
+ {datatype, bytesize},
+ {level, advanced},
+ {default, "128MB"}
+]}.
+
%% @doc Describes the minimum size a file must have to be _excluded_
%% from the merge. Files smaller than the threshold will be
%% included. Increasing the value will cause _more_ files to be
@@ -218,6 +300,13 @@
{default, "10MB"}
]}.
+%% @see bitcask.merge.thresholds.small_file
+{mapping, "multi_backend.$name.bitcask.thresholds.small_file", "riak_kv.multi_backend", [
+ {datatype, bytesize},
+ {level, advanced},
+ {default, "10MB"}
+]}.
+
%% @doc Fold keys thresholds will reuse the keydir if another fold was
%% started less than `fold.max_age` ago and there were less than
%% `fold.max_puts` updates. Otherwise it will wait until all current
@@ -229,6 +318,13 @@
{default, unlimited}
]}.
+%% @see bitcask.fold.max_age
+{mapping, "multi_backend.$name.bitcask.fold.max_age", "riak_kv.multi_backend", [
+ {datatype, [{atom, unlimited}, {duration, ms}]},
+ {level, advanced},
+ {default, unlimited}
+]}.
+
{translation, "bitcask.max_fold_age",
fun(Conf) ->
case cuttlefish:conf_get("bitcask.fold.max_age", Conf) of
@@ -248,6 +344,13 @@
{default, 0}
]}.
+%% @see bitcask.fold.max_age
+{mapping, "multi_backend.$name.bitcask.fold.max_puts", "riak_kv.multi_backend", [
+ {datatype, [integer, {atom, unlimited}]},
+ {level, advanced},
+ {default, 0}
+]}.
+
{translation, "bitcask.max_fold_puts",
fun(Conf) ->
case cuttlefish:conf_get("bitcask.fold.max_puts", Conf) of
@@ -270,6 +373,13 @@
{default, off}
]}.
+%% @see bitcask.expiry
+{mapping, "multi_backend.$name.bitcask.expiry", "riak_kv.multi_backend", [
+ {datatype, [{atom, off}, {duration, s}]},
+ {level, advanced},
+ {default, off}
+]}.
+
{translation, "bitcask.expiry_secs",
fun(Conf) ->
case cuttlefish:conf_get("bitcask.expiry", Conf) of
@@ -290,6 +400,13 @@
{level, advanced}
]}.
+%% @see bitcask.hintfile_checksums
+{mapping, "multi_backend.$name.bitcask.hintfile_checksums", "riak_kv.multi_backend", [
+ {default, strict},
+ {datatype, {enum, [strict, allow_missing]}},
+ {level, advanced}
+]}.
+
{translation, "bitcask.require_hint_crc",
fun(Conf) ->
case cuttlefish:conf_get("bitcask.hintfile_checksums", Conf) of
@@ -314,6 +431,13 @@
{default, 0}
]}.
+%% @see bitcask.expiry.grace_time
+{mapping, "multi_backend.$name.bitcask.expiry.grace_time", "riak_kv.multi_backend", [
+ {datatype, {duration, s}},
+ {level, advanced},
+ {default, 0}
+]}.
+
%% @doc Configure how Bitcask writes data to disk.
%% erlang: Erlang's built-in file API
%% nif: Direct calls to the POSIX C API
@@ -327,135 +451,6 @@
{datatype, {enum, [erlang, nif]}}
]}.
-%% @see bitcask.data_root
-{mapping, "multi_backend.$name.bitcask.data_root", "riak_kv.multi_backend", [
- {level, advanced},
- {datatype, directory}
-]}.
-
-%% @see bitcask.open_timeout
-{mapping, "multi_backend.$name.bitcask.open_timeout", "riak_kv.multi_backend", [
- {default, "4s"},
- {datatype, {duration, s}},
- {level, advanced}
-]}.
-
-%% @see bitcask.sync.strategy
-{mapping, "multi_backend.$name.bitcask.sync.strategy", "riak_kv.multi_backend", [
- {default, none},
- {datatype, {enum, [none, o_sync, interval]}},
- {level, advanced}
-]}.
-
-%% @see bitcask.sync.strategy
-{mapping, "multi_backend.$name.bitcask.sync.interval", "riak_kv.multi_backend", [
- {datatype, {duration, s}},
- {level, advanced}
-]}.
-
-%% @see bitcask.max_file_size
-{mapping, "multi_backend.$name.bitcask.max_file_size", "riak_kv.multi_backend", [
- {default, "2GB"},
- {datatype, bytesize},
- {level, advanced}
-]}.
-
-
-%% @see bitcask.merge.policy
-{mapping, "multi_backend.$name.bitcask.merge.policy", "riak_kv.multi_backend", [
- {default, always},
- {datatype, {enum, [always, never, window]}},
- {level, advanced}
-]}.
-
-%% @see bitcask.merge.policy
-{mapping, "multi_backend.$name.bitcask.merge.window.start", "riak_kv.multi_backend", [
- {default, 0},
- {datatype, integer},
- {level, advanced}
-]}.
-
-%% @see bitcask.merge.policy
-{mapping, "multi_backend.$name.bitcask.merge.window.end", "riak_kv.multi_backend", [
- {default, 23},
- {datatype, integer},
- {level, advanced}
-]}.
-
-%% @see bitcask.merge.triggers.fragmentation
-{mapping, "multi_backend.$name.bitcask.merge.triggers.fragmentation", "riak_kv.multi_backend", [
- {datatype, integer},
- {level, advanced},
- {default, 60},
- {validators, ["is_percentage"]}
-]}.
-
-
-%% @see bitcask.merge.triggers.dead_bytes
-{mapping, "multi_backend.$name.bitcask.merge.triggers.dead_bytes", "riak_kv.multi_backend", [
- {datatype, bytesize},
- {level, advanced},
- {default, "512MB"}
-]}.
-
-%% @see bitcask.merge.thresholds.fragmentation
-{mapping, "multi_backend.$name.bitcask.thresholds.fragmentation", "riak_kv.multi_backend", [
- {datatype, integer},
- {level, advanced},
- {default, 40},
- {validators, ["is_percentage"]}
-]}.
-
-%% @see bitcask.merge.thresholds.dead_bytes
-{mapping, "multi_backend.$name.bitcask.thresholds.dead_bytes", "riak_kv.multi_backend", [
- {datatype, bytesize},
- {level, advanced},
- {default, "128MB"}
-]}.
-
-%% @see bitcask.merge.thresholds.small_file
-{mapping, "multi_backend.$name.bitcask.thresholds.small_file", "riak_kv.multi_backend", [
- {datatype, bytesize},
- {level, advanced},
- {default, "10MB"}
-]}.
-
-%% @see bitcask.fold.max_age
-{mapping, "multi_backend.$name.bitcask.fold.max_age", "riak_kv.multi_backend", [
- {datatype, [{atom, unlimited}, {duration, ms}]},
- {level, advanced},
- {default, unlimited}
-]}.
-
-%% @see bitcask.fold.max_age
-{mapping, "multi_backend.$name.bitcask.fold.max_puts", "riak_kv.multi_backend", [
- {datatype, [integer, {atom, unlimited}]},
- {level, advanced},
- {default, 0}
-]}.
-
-%% @see bitcask.expiry
-{mapping, "multi_backend.$name.bitcask.expiry", "riak_kv.multi_backend", [
- {datatype, [{atom, off}, {duration, s}]},
- {level, advanced},
- {default, off}
-]}.
-
-
-%% @see bitcask.hintfile_checksums
-{mapping, "multi_backend.$name.bitcask.hintfile_checksums", "riak_kv.multi_backend", [
- {default, strict},
- {datatype, {enum, [strict, allow_missing]}},
- {level, advanced}
-]}.
-
-%% @see bitcask.expiry.grace_time
-{mapping, "multi_backend.$name.bitcask.expiry.grace_time", "riak_kv.multi_backend", [
- {datatype, {duration, s}},
- {level, advanced},
- {default, 0}
-]}.
-
%% @see bitcask.io_mode
{mapping, "multi_backend.$name.bitcask.io_mode", "riak_kv.multi_backend", [
{default, erlang},
Oops, something went wrong.

0 comments on commit b6dfd12

Please sign in to comment.