yuqi1129 commented on code in PR #6717:
URL: https://github.com/apache/gravitino/pull/6717#discussion_r2003301929
##########
authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java:
##########
@@ -786,7 +783,9 @@ private void createRangerServiceIfNecessary(Map<String,
String> config, String s
try {
rangerClient.getService(serviceName);
} catch (RangerServiceException rse) {
- if (ClientResponse.Status.NOT_FOUND.equals(rse.getStatus())) {
+ if (Boolean.parseBoolean(
+
config.get(RangerAuthorizationProperties.RANGER_SERVICE_CREATE_IF_ABSENT))
+ && ClientResponse.Status.NOT_FOUND.equals(rse.getStatus())) {
Review Comment:
You have changed the original design:
Before: If `RANGER_SERVICE_CREATE_IF_ABSENT` is false, there will be no
exception in any condition.
Now: If `RANGER_SERVICE_CREATE_IF_ABSENT` is false and the service is
unavailable, you will throw
```java
throw new AuthorizationPluginException(
"Fail to get ranger service name %s, exception: %s",
serviceName, rse.getMessage());
```
--
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]