gh-yzou commented on code in PR #1758: URL: https://github.com/apache/polaris/pull/1758#discussion_r2121940820
########## 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: @dimas-b For the getConfiguration function, i think it make sense to have realmContext, instead of PolarisCallContext since the configuration is per Realm. So i think in short term, it make sense to deprecate the usage of the calls that uses PolarisCallContext, and start using the realmContext one, i will do that as soon as possible. in long run, we can definitely leverage CDI once we figure out how to propagate request scoped context in the background thread correctly. -- 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