xunliu commented on code in PR #6253:
URL: https://github.com/apache/gravitino/pull/6253#discussion_r1916585432
##########
core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java:
##########
@@ -205,10 +205,8 @@ public void
initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
LOG.info("Authorization provider is not set!");
return;
}
- try {
- BaseAuthorization<?> authorization =
- BaseAuthorization.createAuthorization(classLoader,
authorizationProvider);
-
+ try (BaseAuthorization<?> authorization =
Review Comment:
I think this change is ok.
Another question is:
> Should the authorization be closed after creating plugin? Do we need close
method? cc @xunliu
We already closed the authorization plugin in the
`core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java#L229`
```
@Override
public void close() throws IOException {
if (ops != null) {
ops.close();
ops = null;
}
if (authorizationPlugin != null) {
authorizationPlugin.close();
authorizationPlugin = null;
}
if (catalogCredentialManager != null) {
catalogCredentialManager.close();
catalogCredentialManager = null;
}
}
```
--
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]