You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "collado-mike (via GitHub)" <gi...@apache.org> on 2024/10/28 20:14:42 UTC

[PR] Add support for realm-specific configuration overrides [polaris]

collado-mike opened a new pull request, #407:
URL: https://github.com/apache/polaris/pull/407

   # Description
   
   The `PolarisConfigurationStore` allows for server-level configuration parameters, but doesn't allow for realm-specific configuration overrides. In a multi-tenant installation, realm-specific configuration should be expected and supported.
   
   Fixes # (issue)
   
   ## Type of change
   
   Please delete options that are not relevant.
   
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Documentation update
   - [X] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [ ] This change requires a documentation update
   
   # How Has This Been Tested?
   
   Adds unit test for `DefaultConfigurationStore`
   
   - [X] DefaultConfigurationStoreTest
   
   **Test Configuration**:
   * Hardware:
   * Toolchain:
   * SDK:
   
   # Checklist:
   
   Please delete options that are not relevant.
   
   - [X] I have performed a self-review of my code
   - [X] I have commented my code, particularly in hard-to-understand areas
   - [ ] I have made corresponding changes to the documentation
   - [ ] My changes generate no new warnings
   - [ ] If adding new functionality, I have discussed my implementation with the community using the linked GitHub issue
   


-- 
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-unsubscribe@polaris.apache.org

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


Re: [PR] Add support for realm-specific configuration overrides [polaris]

Posted by "collado-mike (via GitHub)" <gi...@apache.org>.
collado-mike commented on code in PR #407:
URL: https://github.com/apache/polaris/pull/407#discussion_r1819874740


##########
polaris-service/src/test/java/org/apache/polaris/service/config/DefaultConfigurationStoreTest.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.config;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Map;
+import org.apache.polaris.core.PolarisCallContext;
+import org.apache.polaris.core.PolarisDefaultDiagServiceImpl;
+import org.apache.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory;
+import org.junit.jupiter.api.Test;
+
+class DefaultConfigurationStoreTest {

Review Comment:
   Blame intellij :) 



-- 
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-unsubscribe@polaris.apache.org

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


Re: [PR] Add support for realm-specific configuration overrides [polaris]

Posted by "collado-mike (via GitHub)" <gi...@apache.org>.
collado-mike merged PR #407:
URL: https://github.com/apache/polaris/pull/407


-- 
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-unsubscribe@polaris.apache.org

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


Re: [PR] Add support for realm-specific configuration overrides [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #407:
URL: https://github.com/apache/polaris/pull/407#discussion_r1819813468


##########
polaris-service/src/main/java/org/apache/polaris/service/config/DefaultConfigurationStore.java:
##########
@@ -21,18 +21,30 @@
 import java.util.Map;
 import org.apache.polaris.core.PolarisCallContext;
 import org.apache.polaris.core.PolarisConfigurationStore;
+import org.apache.polaris.core.context.CallContext;
+import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 public class DefaultConfigurationStore implements PolarisConfigurationStore {
-  private final Map<String, Object> properties;
+  private final Map<String, Object> config;
+  private final Map<String, Map<String, Object>> realmConfig;

Review Comment:
   nit: Maybe a name like globalConfig or fallbackConfig would be more clear



##########
polaris-service/src/main/java/org/apache/polaris/service/config/PolarisApplicationConfig.java:
##########
@@ -170,7 +169,12 @@ public TaskHandlerConfiguration getTaskHandler() {
 
   @JsonProperty("featureConfiguration")
   public void setFeatureConfiguration(Map<String, Object> featureConfiguration) {
-    this.configurationStore = new DefaultConfigurationStore(featureConfiguration);
+    this.featureConfiguration = featureConfiguration;
+  }
+
+  @JsonProperty("realmFeatureConfiguration")

Review Comment:
   What does the config file look like in this case? It seems to be something like...
   
   ```
   featureConfiguration:
     SOME_FEATURE: true
   
   realmFeatureConfiguration:
     realm_1:
       SOME_FEATURE: true
     realm_2:
       SOME_FEATURE: false
   ```
   
   Can we do any validation that these realms actually exist?



##########
polaris-service/src/test/java/org/apache/polaris/service/config/DefaultConfigurationStoreTest.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.config;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Map;
+import org.apache.polaris.core.PolarisCallContext;
+import org.apache.polaris.core.PolarisDefaultDiagServiceImpl;
+import org.apache.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory;
+import org.junit.jupiter.api.Test;
+
+class DefaultConfigurationStoreTest {

Review Comment:
   Other tests are `public`



-- 
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-unsubscribe@polaris.apache.org

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


Re: [PR] Add support for realm-specific configuration overrides [polaris]

Posted by "collado-mike (via GitHub)" <gi...@apache.org>.
collado-mike commented on code in PR #407:
URL: https://github.com/apache/polaris/pull/407#discussion_r1819874577


##########
polaris-service/src/main/java/org/apache/polaris/service/config/PolarisApplicationConfig.java:
##########
@@ -170,7 +169,12 @@ public TaskHandlerConfiguration getTaskHandler() {
 
   @JsonProperty("featureConfiguration")
   public void setFeatureConfiguration(Map<String, Object> featureConfiguration) {
-    this.configurationStore = new DefaultConfigurationStore(featureConfiguration);
+    this.featureConfiguration = featureConfiguration;
+  }
+
+  @JsonProperty("realmFeatureConfiguration")

Review Comment:
   yeah, that's the proposed configuration structure in the yaml file. No, we can't validate that the realms exist currently - there is no agreed upon interface for storing/retrieving realms and the only persistence API doesn't know anything about realms.



-- 
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-unsubscribe@polaris.apache.org

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