adutra commented on code in PR #3755:
URL: https://github.com/apache/polaris/pull/3755#discussion_r2823568417
##########
polaris-core/src/main/java/org/apache/polaris/core/config/PolarisConfiguration.java:
##########
@@ -55,33 +59,33 @@ public abstract class PolarisConfiguration<T> {
* configs.
*/
private static void registerConfiguration(PolarisConfiguration<?>
configuration) {
- for (PolarisConfiguration<?> existingConfiguration : allConfigurations) {
- if (existingConfiguration.key.equals(configuration.key)) {
+ if (ALL_CONFIGURATIONS.putIfAbsent(configuration.key(), configuration) !=
null) {
+ throw new IllegalArgumentException(
+ String.format("Config '%s' is already in use", configuration.key));
+ }
+ if (configuration.hasCatalogConfig()) {
+ if (!ALL_CATALOG_CONFIGS.add(configuration.catalogConfig())) {
Review Comment:
> since failures are likely to break the whole runtime in the current state
of the code
Yes, the assumption is that any error here is fatal and will make the JVM
exit. I don't think we could bring the collections to contain inconsistent data.
--
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]