-
Notifications
You must be signed in to change notification settings - Fork 377
Open
Labels
type:featureFeature RequestsFeature Requests
Description
Description
Currently, Amoro only supports static configuration via conf.yaml or environment variables prefixed with AMORO_; any change requires an Amoro service restart.
Use case/motivation
This issue proposes a database-backed dynamic configuration mechanism that lets users update settings without restarting the service.
Describe the solution
Amoro has two kinds of configuration:
- Configuration for the AMS service itself
- Configuration for AMS plugins
The dynamic mechanism must cover both categories. Because plugins are extensible, the solution must be flexible.
Database design
Add a new table dynamic_conf to the AMS database:
CREATE TABLE dynamic_conf (
id BIGINT PRIMARY KEY AUTO_INCREMENT,
key VARCHAR(256) NOT NULL,
value VARCHAR(256) NOT NULL,
conf_group VARCHAR(256) NOT NULL COMMENT 'Group: AMS for service, PLUGIN_{category} for plugins',
plugin_name VARCHAR(256) COMMENT 'Plugin identifier; valid only when conf_group = PLUGIN_*',
UNIQUE KEY uk_conf (conf_group, plugin_name, key)
);
Code design
Today all configuration flows through org.apache.amoro.config.Configurations, which is essentially a Map.
Introduce a new interface:
public interface ConfigurationManager {
Configurations getServerConfigurations(); // AMS-level config
Configurations getPluginConfigurations(String pluginCategory, String pluginName);
}
- Implementations of Configurations returned by ConfigurationManager will override getOptional(ConfigOption key) so that values are read from the database.
- Refactor constructors of CatalogManager, TableManager, TableProcessService, etc. to accept a ConfigurationManager instead of the static serverConfigurations.
- Refactor AbstractPluginManager to receive ConfigurationManager and obtain plugin configs through it.
- Change the open method of ActivePlugin to accept a Configurations object instead of the legacy Map<String, String>.
Subtasks
No response
Related issues
No response
Are you willing to submit a PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type:featureFeature RequestsFeature Requests