refactor(ds_schema): Extract common builtin fields
This commit is contained in:
parent
abe41de19b
commit
ea48b1265d
|
@ -112,25 +112,6 @@ fields(builtin) ->
|
||||||
importance => ?IMPORTANCE_HIDDEN
|
importance => ?IMPORTANCE_HIDDEN
|
||||||
}
|
}
|
||||||
)},
|
)},
|
||||||
{data_dir,
|
|
||||||
sc(
|
|
||||||
string(),
|
|
||||||
#{
|
|
||||||
mapping => "emqx_durable_storage.db_data_dir",
|
|
||||||
required => false,
|
|
||||||
importance => ?IMPORTANCE_MEDIUM,
|
|
||||||
desc => ?DESC(builtin_data_dir)
|
|
||||||
}
|
|
||||||
)},
|
|
||||||
{n_shards,
|
|
||||||
sc(
|
|
||||||
pos_integer(),
|
|
||||||
#{
|
|
||||||
default => 12,
|
|
||||||
importance => ?IMPORTANCE_MEDIUM,
|
|
||||||
desc => ?DESC(builtin_n_shards)
|
|
||||||
}
|
|
||||||
)},
|
|
||||||
%% TODO: Deprecate once cluster management and rebalancing is implemented.
|
%% TODO: Deprecate once cluster management and rebalancing is implemented.
|
||||||
{"n_sites",
|
{"n_sites",
|
||||||
sc(
|
sc(
|
||||||
|
@ -157,27 +138,8 @@ fields(builtin) ->
|
||||||
default => #{},
|
default => #{},
|
||||||
importance => ?IMPORTANCE_HIDDEN
|
importance => ?IMPORTANCE_HIDDEN
|
||||||
}
|
}
|
||||||
)},
|
|
||||||
{local_write_buffer,
|
|
||||||
sc(
|
|
||||||
ref(builtin_write_buffer),
|
|
||||||
#{
|
|
||||||
importance => ?IMPORTANCE_HIDDEN,
|
|
||||||
desc => ?DESC(builtin_write_buffer)
|
|
||||||
}
|
|
||||||
)},
|
|
||||||
{layout,
|
|
||||||
sc(
|
|
||||||
hoconsc:union(builtin_layouts()),
|
|
||||||
#{
|
|
||||||
desc => ?DESC(builtin_layout),
|
|
||||||
importance => ?IMPORTANCE_MEDIUM,
|
|
||||||
default =>
|
|
||||||
#{
|
|
||||||
<<"type">> => wildcard_optimized
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)}
|
)}
|
||||||
|
| common_builtin_fields()
|
||||||
];
|
];
|
||||||
fields(builtin_write_buffer) ->
|
fields(builtin_write_buffer) ->
|
||||||
[
|
[
|
||||||
|
@ -252,6 +214,49 @@ fields(layout_builtin_reference) ->
|
||||||
)}
|
)}
|
||||||
].
|
].
|
||||||
|
|
||||||
|
common_builtin_fields() ->
|
||||||
|
[
|
||||||
|
{data_dir,
|
||||||
|
sc(
|
||||||
|
string(),
|
||||||
|
#{
|
||||||
|
mapping => "emqx_durable_storage.db_data_dir",
|
||||||
|
required => false,
|
||||||
|
importance => ?IMPORTANCE_MEDIUM,
|
||||||
|
desc => ?DESC(builtin_data_dir)
|
||||||
|
}
|
||||||
|
)},
|
||||||
|
{n_shards,
|
||||||
|
sc(
|
||||||
|
pos_integer(),
|
||||||
|
#{
|
||||||
|
default => 12,
|
||||||
|
importance => ?IMPORTANCE_MEDIUM,
|
||||||
|
desc => ?DESC(builtin_n_shards)
|
||||||
|
}
|
||||||
|
)},
|
||||||
|
{local_write_buffer,
|
||||||
|
sc(
|
||||||
|
ref(builtin_write_buffer),
|
||||||
|
#{
|
||||||
|
importance => ?IMPORTANCE_HIDDEN,
|
||||||
|
desc => ?DESC(builtin_write_buffer)
|
||||||
|
}
|
||||||
|
)},
|
||||||
|
{layout,
|
||||||
|
sc(
|
||||||
|
hoconsc:union(builtin_layouts()),
|
||||||
|
#{
|
||||||
|
desc => ?DESC(builtin_layout),
|
||||||
|
importance => ?IMPORTANCE_MEDIUM,
|
||||||
|
default =>
|
||||||
|
#{
|
||||||
|
<<"type">> => wildcard_optimized
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
].
|
||||||
|
|
||||||
desc(builtin) ->
|
desc(builtin) ->
|
||||||
?DESC(builtin);
|
?DESC(builtin);
|
||||||
desc(builtin_write_buffer) ->
|
desc(builtin_write_buffer) ->
|
||||||
|
|
Loading…
Reference in New Issue