baiyangtx opened a new issue, #4054:
URL: https://github.com/apache/amoro/issues/4054
### 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:
1. Configuration for the AMS service itself
2. 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?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of
Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]