mneethiraj commented on code in PR #595:
URL: https://github.com/apache/ranger/pull/595#discussion_r2323340109


##########
agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java:
##########
@@ -1490,7 +1490,7 @@ private static final class LogHistory {
     private boolean isSynchronousPolicyRefresh() {
         boolean ret = false;
         if (this.getServiceConfigs() != null && this.pluginConfig != null && 
this.pluginConfig.getServiceType() != null) {
-            String synchronousPolicyRefreshConfigName = 
"ranger.plugins.conf.policy.refresh.synchronous";
+            String synchronousPolicyRefreshConfigName = 
String.format("ranger.plugin.%s.policy.refresh.synchronous", 
this.pluginConfig.getServiceType());
             if 
(this.getServiceConfigs().containsKey(synchronousPolicyRefreshConfigName)) {
                 boolean synchronousPolicyRefreshConfigValue = 
Boolean.parseBoolean(this.getServiceConfigs().get(synchronousPolicyRefreshConfigName).trim().toLowerCase());
                 if (synchronousPolicyRefreshConfigValue) {

Review Comment:
   I suggest replacing lines 1492 - 1496 with the following:
   
   ```
   Map<String, String> serviceConfigs      = this.serviceConfigs;
   String              isSyncPolicyRefresh = serviceConfigs == null ? null : 
serviceConfigs.get(pluginConfig.getPropertyPrefix() + 
".policy.refresh.synchronous");
   
   if (Boolean.parseBoolean(isSyncPolicyRefresh)) {
   ```
   
   Also, I suggest moving above code into `RangerBasePlugin.setServiceConfig()` 
i.e. remove `isSynchronousPolicyRefresh()` method.



-- 
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]

Reply via email to