dimas-b commented on code in PR #1758:
URL: https://github.com/apache/polaris/pull/1758#discussion_r2121893469
##########
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 concern is having materially different inputs in the various lookup
methods. Specifically, if one method has a "realm" parameter, all of them
should have it.
I'm file with either `RealmContext` or `String` as the type of the "realm"
parameter (slightly prefer `RealmContext`).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]