jerryshao commented on code in PR #3946:
URL: https://github.com/apache/gravitino/pull/3946#discussion_r1671659713
##########
core/src/main/java/com/datastrato/gravitino/connector/BaseCatalog.java:
##########
@@ -169,12 +180,59 @@ public CatalogOperations ops() {
return ops;
}
+ public AuthorizationPlugin getAuthorizationPlugin() {
+ if (authorization == null) {
+ synchronized (this) {
+ if (authorization == null) {
+ authorization = createAuthorizationPluginInstance();
+ }
+ }
+ }
+ return authorization.plugin();
+ }
+
+ private BaseAuthorization<?> createAuthorizationPluginInstance() {
+ String authorizationProvider =
+ (String) catalogPropertiesMetadata().getOrDefault(conf,
AUTHORIZATION_PROVIDER);
+ if (authorizationProvider == null) {
+ throw new IllegalArgumentException("Authorization provider is not set");
+ }
Review Comment:
I found that the default value is null, so this will always throw an
exception, right?
--
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]