dimas-b commented on code in PR #1557:
URL: https://github.com/apache/polaris/pull/1557#discussion_r2085800914


##########
polaris-core/src/main/java/org/apache/polaris/core/config/PolarisConfiguration.java:
##########
@@ -92,27 +103,51 @@ public Builder<T> defaultValue(T defaultValue) {
       return this;
     }
 
-    public Builder<T> catalogConfig(String catalogConfig) {
-      this.catalogConfig = Optional.of(catalogConfig);
+    public Builder<T> addCatalogConfig(String catalogConfig) {
+      if (!catalogConfig.startsWith(catalogConfigPrefix)) {
+        throw new IllegalArgumentException(
+            "Catalog configs are expected to start with " + 
catalogConfigPrefix);
+      }
+      if (allCatalogConfigs.contains(catalogConfig)) {
+        throw new IllegalArgumentException("Catalog config already exists: " + 
catalogConfig);
+      }
+      this.catalogConfigs.add(catalogConfig);
+      allCatalogConfigs.add(catalogConfig);
+      return this;
+    }
+
+    /**
+     * Used to support backwards compatability before there were reserved 
properties. Usage of this
+     * method should be removed over time.
+     */
+    @Deprecated
+    public Builder<T> addCatalogConfigUnsafe(String catalogConfig) {
+      LOGGER.info("catalogConfigUnsafe is deprecated! Use catalogConfig() 
instead.");
+      if (allCatalogConfigs.contains(catalogConfig)) {
+        throw new IllegalArgumentException("Catalog config already exists: " + 
catalogConfig);
+      }
+      this.catalogConfigs.add(catalogConfig);
+      allCatalogConfigs.add(catalogConfig);

Review Comment:
   The latest state of the PR LGTM (except the `public` mutable list).



-- 
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: issues-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to