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


##########
polaris-core/src/main/java/org/apache/polaris/core/config/PolarisConfigurationStore.java:
##########
@@ -57,14 +62,48 @@ public interface PolarisConfigurationStore {
    * @param defaultValue the default value if the configuration key has no 
value
    * @return the current value or the supplied default value
    * @param <T> the type of the configuration value
+   * @deprecated this function is going to be deprecated, please use the 
following function to get
+   *     the configuration value in a more robust way: getConfiguration(String 
realm, String
+   *     configName, @Nonnull T defaultValue) This function can not be called 
outside of active
+   *     request scope, such as background tasks (TaskExecutor).
    */
+  @Deprecated
   default <T> @Nonnull T getConfiguration(
       PolarisCallContext ctx, String configName, @Nonnull T defaultValue) {
     Preconditions.checkNotNull(defaultValue, "Cannot pass null as a default 
value");
     T configValue = getConfiguration(ctx, configName);
     return configValue != null ? configValue : defaultValue;
   }
 
+  /**
+   * Retrieve the current value for a configuration key for a given realm. May 
be null if not set.
+   *
+   * @param realm the realm identifier
+   * @param configName the name of the configuration key to check
+   * @return the current value set for the configuration key for the given 
realm, or null if not set
+   * @param <T> the type of the configuration value
+   */
+  default <T> @Nullable T getConfiguration(String realm, String configName) {

Review Comment:
   > why would a new method have to be the same with other methods for its 
parameters?
   
   Not all parameters, but those that affect lookup results, but are not always 
specified in method calls. In this case - realm ID (since configuration can be 
different in different realms). This is what I meant by "API skew".



-- 
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