refactor(ds_schema): Rename backend builtin -> builtin_raft
This commit is contained in:
parent
ea48b1265d
commit
8990b1312b
|
@ -18,7 +18,7 @@
|
|||
-module(emqx_ds_schema).
|
||||
|
||||
%% API:
|
||||
-export([schema/0, translate_builtin/1]).
|
||||
-export([schema/0, translate_builtin_raft/1]).
|
||||
|
||||
%% Behavior callbacks:
|
||||
-export([fields/1, desc/1, namespace/0]).
|
||||
|
@ -36,9 +36,9 @@
|
|||
%% API
|
||||
%%================================================================================
|
||||
|
||||
translate_builtin(
|
||||
translate_builtin_raft(
|
||||
Backend = #{
|
||||
backend := builtin,
|
||||
backend := builtin_raft,
|
||||
n_shards := NShards,
|
||||
n_sites := NSites,
|
||||
replication_factor := ReplFactor,
|
||||
|
@ -83,24 +83,24 @@ schema() ->
|
|||
ds_schema(#{
|
||||
default =>
|
||||
#{
|
||||
<<"backend">> => builtin
|
||||
<<"backend">> => builtin_raft
|
||||
},
|
||||
importance => ?IMPORTANCE_MEDIUM,
|
||||
desc => ?DESC(messages)
|
||||
})}
|
||||
].
|
||||
|
||||
fields(builtin) ->
|
||||
%% Schema for the builtin backend:
|
||||
fields(builtin_raft) ->
|
||||
%% Schema for the builtin_raft backend:
|
||||
[
|
||||
{backend,
|
||||
sc(
|
||||
builtin,
|
||||
builtin_raft,
|
||||
#{
|
||||
'readOnly' => true,
|
||||
default => builtin,
|
||||
default => builtin_raft,
|
||||
importance => ?IMPORTANCE_MEDIUM,
|
||||
desc => ?DESC(builtin_backend)
|
||||
desc => ?DESC(backend_type)
|
||||
}
|
||||
)},
|
||||
{'_config_handler',
|
||||
|
@ -108,7 +108,7 @@ fields(builtin) ->
|
|||
{module(), atom()},
|
||||
#{
|
||||
'readOnly' => true,
|
||||
default => {?MODULE, translate_builtin},
|
||||
default => {?MODULE, translate_builtin_raft},
|
||||
importance => ?IMPORTANCE_HIDDEN
|
||||
}
|
||||
)},
|
||||
|
@ -257,8 +257,8 @@ common_builtin_fields() ->
|
|||
)}
|
||||
].
|
||||
|
||||
desc(builtin) ->
|
||||
?DESC(builtin);
|
||||
desc(builtin_raft) ->
|
||||
?DESC(builtin_raft);
|
||||
desc(builtin_write_buffer) ->
|
||||
?DESC(builtin_write_buffer);
|
||||
desc(layout_builtin_wildcard_optimized) ->
|
||||
|
@ -275,7 +275,7 @@ desc(_) ->
|
|||
ds_schema(Options) ->
|
||||
sc(
|
||||
hoconsc:union([
|
||||
ref(builtin)
|
||||
ref(builtin_raft)
|
||||
| emqx_schema_hooks:injection_point('durable_storage.backends', [])
|
||||
]),
|
||||
Options
|
||||
|
|
|
@ -5,15 +5,15 @@ messages.desc:
|
|||
"""~
|
||||
Configuration related to the durable storage of MQTT messages.~"""
|
||||
|
||||
builtin.label: "Builtin backend"
|
||||
builtin.desc:
|
||||
builtin_raft.label: "Builtin backend with Raft replication"
|
||||
builtin_raft.desc:
|
||||
"""~
|
||||
Builtin session storage backend utilizing embedded RocksDB key-value store.~"""
|
||||
|
||||
builtin_backend.label: "Backend type"
|
||||
builtin_backend.desc:
|
||||
backend_type.label: "Backend type"
|
||||
backend_type.desc:
|
||||
"""~
|
||||
Built-in backend.~"""
|
||||
Backend type.~"""
|
||||
|
||||
builtin_data_dir.label: "Database location"
|
||||
builtin_data_dir.desc:
|
||||
|
|
Loading…
Reference in New Issue