[GitHub] [carbondata] kumarvishal09 commented on a change in pull request #3505: [CARBONDATA-3615]: Show metacache shows the index server index-dictionary files when data loaded after index server disabled using set command

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

[GitHub] [carbondata] kumarvishal09 commented on a change in pull request #3505: [CARBONDATA-3615]: Show metacache shows the index server index-dictionary files when data loaded after index server disabled using set command

GitBox
kumarvishal09 commented on a change in pull request #3505: [CARBONDATA-3615]: Show metacache shows the index server index-dictionary files when data loaded after index server disabled using set command
URL: https://github.com/apache/carbondata/pull/3505#discussion_r355909886
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java
 ##########
 @@ -1664,17 +1664,29 @@ private void validateDetailQueryBatchSize() {
   public boolean isDistributedPruningEnabled(String dbName, String tableName) {
     // Check if user has enabled/disabled the use of index server for the current session using
     // the set command
-    String configuredValue = getSessionPropertyValue(
-        CarbonCommonConstants.CARBON_ENABLE_INDEX_SERVER + "." + dbName + "." + tableName);
-    if (configuredValue == null) {
-      // if not set in session properties then check carbon.properties for the same.
-      configuredValue = getProperty(CarbonCommonConstants.CARBON_ENABLE_INDEX_SERVER);
-    }
-    boolean isServerEnabledByUser = Boolean.parseBoolean(configuredValue);
-    if (isServerEnabledByUser) {
-      LOGGER.info("Distributed Index server is enabled for " + dbName + "." + tableName);
+    String configuredValueForTable = getSessionPropertyValue(
+            CarbonCommonConstants.CARBON_ENABLE_INDEX_SERVER + "." + dbName + "." + tableName);
+    String configuredValue = getProperty(CarbonCommonConstants.CARBON_ENABLE_INDEX_SERVER);
+
+    /**
+     * Carbon.enable.index.server | carbon.enable.index.server.dbname.tablename | Output
+     *  False                         False                                         False
+     *  False                         True                                          False
+     *  True                          False                                         False
+     *  True                          True                                          True
+     *  True                          NULL                                          True
+     *  False                         NULL                                          False
+     */
+
+    if (!Boolean.parseBoolean(configuredValue)) {
+      return false;
+    } else if (Boolean.parseBoolean(configuredValue) && configuredValueForTable != null
+            && !Boolean.parseBoolean(configuredValueForTable)) {
+      return false;
+    } else {
+      LOGGER.info("Distributed Index Server is enabled for " + dbName + "." + tableName);
 
 Review comment:
   no need to print when it is enabled print when it is disabled

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