gh-yzou commented on code in PR #1758: URL: https://github.com/apache/polaris/pull/1758#discussion_r2119654257
########## 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: The whole refactoring to use the new interface is fairly large and touches persistent due to the loadTasks API, we will beak the whole refactoring to three parts: 1) this PR that introduces the new API that only requires realm, and fixes the task executor to unblock the release 2) a separate PR to switch other non-persistent part to use this new API 3) a separate PR to switch the loadTasks to use the new API -- 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