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