carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvram...@apache.org
Subject [1/2] incubator-carbondata git commit: wrong message getting displayed while compaction.
Date Sat, 17 Sep 2016 20:06:33 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master fec8a9186 -> 4003811b0


wrong message getting displayed while compaction.


Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/9ba7642d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/9ba7642d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/9ba7642d

Branch: refs/heads/master
Commit: 9ba7642d2866866faf3d0467bfe6edf7080fd304
Parents: fec8a91
Author: ravikiran <ravikiran.sn042@gmail.com>
Authored: Thu Sep 8 21:25:44 2016 +0530
Committer: Venkata Ramana G <ramana.gollamudi@huawei.com>
Committed: Sun Sep 18 01:32:42 2016 +0530

----------------------------------------------------------------------
 .../spark/merger/CarbonCompactionUtil.java      | 24 +++++++++++++-------
 1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/9ba7642d/integration/spark/src/main/java/org/apache/carbondata/integration/spark/merger/CarbonCompactionUtil.java
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/java/org/apache/carbondata/integration/spark/merger/CarbonCompactionUtil.java
b/integration/spark/src/main/java/org/apache/carbondata/integration/spark/merger/CarbonCompactionUtil.java
index b7cc620..b3198b4 100644
--- a/integration/spark/src/main/java/org/apache/carbondata/integration/spark/merger/CarbonCompactionUtil.java
+++ b/integration/spark/src/main/java/org/apache/carbondata/integration/spark/merger/CarbonCompactionUtil.java
@@ -198,24 +198,30 @@ public class CarbonCompactionUtil {
    */
   public static boolean deleteCompactionRequiredFile(String metaFolderPath,
       CompactionType compactionType) {
-    String statusFile;
+    String compactionRequiredFile;
     if (compactionType.equals(CompactionType.MINOR_COMPACTION)) {
-      statusFile = metaFolderPath + CarbonCommonConstants.FILE_SEPARATOR
+      compactionRequiredFile = metaFolderPath + CarbonCommonConstants.FILE_SEPARATOR
           + CarbonCommonConstants.minorCompactionRequiredFile;
     } else {
-      statusFile = metaFolderPath + CarbonCommonConstants.FILE_SEPARATOR
+      compactionRequiredFile = metaFolderPath + CarbonCommonConstants.FILE_SEPARATOR
           + CarbonCommonConstants.majorCompactionRequiredFile;
     }
     try {
-      if (FileFactory.isFileExist(statusFile, FileFactory.getFileType(statusFile))) {
-        if (FileFactory.getCarbonFile(statusFile, FileFactory.getFileType(statusFile)).delete())
{
-          LOGGER.info("Deleted the compaction request file " + statusFile);
+      if (FileFactory
+          .isFileExist(compactionRequiredFile, FileFactory.getFileType(compactionRequiredFile)))
{
+        if (FileFactory
+            .getCarbonFile(compactionRequiredFile, FileFactory.getFileType(compactionRequiredFile))
+            .delete()) {
+          LOGGER.info("Deleted the compaction request file " + compactionRequiredFile);
+          return true;
         } else {
-          LOGGER.error("Unable to delete the compaction request file " + statusFile);
+          LOGGER.error("Unable to delete the compaction request file " + compactionRequiredFile);
         }
+      } else {
+        LOGGER.info("Compaction request file is not present. file is : " + compactionRequiredFile);
       }
     } catch (IOException e) {
-      LOGGER.error("Exception in deleting the compaction request file " + e.getMessage()
);
+      LOGGER.error("Exception in deleting the compaction request file " + e.getMessage());
     }
     return false;
   }
@@ -245,6 +251,8 @@ public class CarbonCompactionUtil {
           LOGGER.error("Not able to create a compaction required file - " + statusFile);
           return false;
         }
+      } else {
+        LOGGER.info("Compaction request file : " + statusFile + " already exist.");
       }
     } catch (IOException e) {
       LOGGER.error("Exception in creating the compaction request file " + e.getMessage()
);


Mime
View raw message