[GitHub] [carbondata] jackylk commented on a change in pull request #3171: [CARBONDATA-3337] Implemented Hadoop RPC framework for index server

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] jackylk commented on a change in pull request #3171: [CARBONDATA-3337] Implemented Hadoop RPC framework for index server

GitBox
jackylk commented on a change in pull request #3171: [CARBONDATA-3337] Implemented Hadoop RPC framework for index server
URL: https://github.com/apache/carbondata/pull/3171#discussion_r277555818
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java
 ##########
 @@ -1601,4 +1601,47 @@ private void validateDetailQueryBatchSize() {
       }
     }
   }
-}
+
+  public String getIndexServerPolicy() {
+    String indexServerPolicy =
+        carbonProperties.getProperty(CarbonCommonConstants.CARBON_INDEX_SERVER_POLICY);
+    if (indexServerPolicy != null) {
+      return validateServerPolicy(indexServerPolicy);
+    } else {
+      return CarbonCommonConstants.CARBON_EMBEDDED_PRUNE_POLICY;
+    }
+  }
+
+  private String validateServerPolicy(String indexServerPolicy) {
+    if (indexServerPolicy.equalsIgnoreCase(CarbonCommonConstants.CARBON_DISTRIBUTED_PRUNE_POLICY)
+        || indexServerPolicy.equalsIgnoreCase(CarbonCommonConstants.CARBON_EMBEDDED_PRUNE_POLICY)
+        || indexServerPolicy.equalsIgnoreCase(CarbonCommonConstants.CARBON_DRIVER_PRUNE_POLICY)) {
+      LOGGER.info("The prune policy set for pruning is: " + indexServerPolicy);
+      return indexServerPolicy;
+    } else {
+      LOGGER.info("The configured value for " + CarbonCommonConstants.CARBON_INDEX_SERVER_POLICY
+          + " is not valid, therefore taking " + CarbonCommonConstants.CARBON_EMBEDDED_PRUNE_POLICY
+          + " as the index server prune policy");
+      return CarbonCommonConstants.CARBON_EMBEDDED_PRUNE_POLICY;
 
 Review comment:
   use CARBON_INDEX_SERVER_POLICY_DEFAULT

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services