carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [20/47] incubator-carbondata git commit: [CARBONDATA-87][Bug] deleting the temp files in case of success / failure of load. (#846)
Date Mon, 01 Aug 2016 10:05:18 GMT
[CARBONDATA-87][Bug] deleting the temp files in case of success / failure of load. (#846)

deleting the temp folder location in case of success / failure of load.
deleting the ktr file from temp location.

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

Branch: refs/heads/master
Commit: 577764bef23c005b3599761e397ffc2110325c36
Parents: bb8b0fd
Author: ravikiran23 <ravikiran.sn042@gmail.com>
Authored: Mon Jul 25 15:43:25 2016 +0530
Committer: Venkata Ramana G <g.ramana.v1@gmail.com>
Committed: Mon Jul 25 15:43:25 2016 +0530

----------------------------------------------------------------------
 .../org/carbondata/spark/load/CarbonLoaderUtil.java  | 14 ++++++++++++++
 .../org/carbondata/spark/rdd/CarbonDataLoadRDD.scala | 15 ++++++++-------
 2 files changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/577764be/integration/spark/src/main/java/org/carbondata/spark/load/CarbonLoaderUtil.java
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/java/org/carbondata/spark/load/CarbonLoaderUtil.java
b/integration/spark/src/main/java/org/carbondata/spark/load/CarbonLoaderUtil.java
index 3d17141..3ecdfe4 100644
--- a/integration/spark/src/main/java/org/carbondata/spark/load/CarbonLoaderUtil.java
+++ b/integration/spark/src/main/java/org/carbondata/spark/load/CarbonLoaderUtil.java
@@ -445,6 +445,20 @@ public final class CarbonLoaderUtil {
     } catch (CarbonUtilException e) {
       LOGGER.error(e, "Failed to delete local data load folder location");
     }
+
+    // delete ktr file.
+    String graphPath = CarbonProperties.getInstance()
+        .getProperty(tempLocationKey, CarbonCommonConstants.STORE_LOCATION_DEFAULT_VAL)
+        + File.separator + "/etl" + File.separator + databaseName + File.separator + tableName
+        + File.separator + loadModel.getSegmentId() + File.separator + loadModel.getTaskNo()
+        + File.separator + tableName + ".ktr";
+    File path = new File(graphPath);
+    if (path.exists()) {
+      if (!path.delete()) {
+        LOGGER.error("failed to delete the ktr file in path " + path);
+      }
+    }
+
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/577764be/integration/spark/src/main/scala/org/carbondata/spark/rdd/CarbonDataLoadRDD.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/scala/org/carbondata/spark/rdd/CarbonDataLoadRDD.scala
b/integration/spark/src/main/scala/org/carbondata/spark/rdd/CarbonDataLoadRDD.scala
index 8869368..60a3a8a 100644
--- a/integration/spark/src/main/scala/org/carbondata/spark/rdd/CarbonDataLoadRDD.scala
+++ b/integration/spark/src/main/scala/org/carbondata/spark/rdd/CarbonDataLoadRDD.scala
@@ -206,14 +206,15 @@ class CarbonDataLoadRDD[K, V](
             case e: Exception =>
               throw e
           } finally {
+            // delete temp location data
+            val newSlice = CarbonCommonConstants.LOAD_FOLDER + loadCount
+            try {
+              CarbonLoaderUtil.deleteLocalDataLoadFolderLocation(model, newSlice)
+            } catch {
+              case e: Exception =>
+                LOGGER.error(e)
+            }
             if (!CarbonCommonConstants.STORE_LOADSTATUS_FAILURE.equals(dataloadStatus)) {
-              val newSlice = CarbonCommonConstants.LOAD_FOLDER + loadCount
-              try {
-                CarbonLoaderUtil.deleteLocalDataLoadFolderLocation(model, newSlice)
-              } catch {
-                case e: Exception =>
-                  LOGGER.error(e)
-              }
               if (CarbonCommonConstants.STORE_LOADSTATUS_PARTIAL_SUCCESS
                   .equals(dataloadStatus)) {
                 logInfo("DataLoad complete")


Mime
View raw message