Expand description
This module defines utilities to work with system parameters (PbSystemParams
in
meta.proto
).
To add a new system parameter:
- Add a new field to
PbSystemParams
inmeta.proto
. - Add a new entry to
for_all_undeprecated_params
in this file. - Add a new method to
reader::SystemParamsReader
.
Modulesยง
- Default values for all parameters.
Macrosยง
- def_
default ๐Define default value functions for those withSome
default values. - def_
default_ ๐opt Define default value functions returningOption
. - def_key ๐Define key constants for fields in
PbSystemParams
for use of other modules. - Define rules to derive a parameter from others. This is useful for parameter type change or semantic change, where a new parameter has to be introduced. When the cluster upgrades to a newer version, we need to ensure the effect of the new parameter is equal to its older versions. For example, if you had
interval_sec
and now you want finer granularity, you can introduce a new paraminterval_ms
and try to derive it frominterval_sec
by overridingFromParams
trait inOverrideFromParams
: - Define check rules when a field is changed. If you want custom rules, please override the default implementation in
OverrideValidateOnSet
below. - impl_
is_ ๐mutable - impl_
param_ ๐value - Derive deserialization from kv pairs.
- Derive serialization to kv pairs.
Structsยง
- Override
From ๐Params
Constantsยง
Traitsยง
- From
Params ๐ - The trait for the value type of a system parameter.
- Validate
OnSet ๐
Functionsยง
- Check if any undeprecated fields are missing.
- Set a system parameter with the given value or default one.
- Try to deserialize deprecated fields as well. Return error if there are unrecognized fields.
- The returned map only contains undeprecated fields. Return error if there are missing fields.
Type Aliasesยง
- Result ๐