carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kumarvisha...@apache.org
Subject carbondata git commit: [CARBONDATA-2962]Even after carbon file is copied to targetfolder(local/hdfs), carbon files is not deleted from temp directory
Date Wed, 26 Sep 2018 07:05:41 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 2ab2254be -> 49f67153a


[CARBONDATA-2962]Even after carbon file is copied to targetfolder(local/hdfs), carbon files
is not deleted from temp directory

Problem:
Even after carbon file is copied to targetfolder(local/hdfs), carbon files is not deleted
from temp directory.
Solution:
After copying Carbon data and index files from temp directory, delete those files.

This closes #2752


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

Branch: refs/heads/master
Commit: 49f67153a21e5a0cb5705adeb0f056eef4d3ed25
Parents: 2ab2254
Author: Indhumathi27 <indhumathim27@gmail.com>
Authored: Mon Sep 24 12:28:47 2018 +0530
Committer: kumarvishal09 <kumarvishal1802@gmail.com>
Committed: Wed Sep 26 12:35:24 2018 +0530

----------------------------------------------------------------------
 .../store/writer/AbstractFactDataWriter.java    | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/49f67153/processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java
----------------------------------------------------------------------
diff --git a/processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java
b/processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java
index ad0e8e0..4afb3ef 100644
--- a/processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java
+++ b/processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java
@@ -270,12 +270,18 @@ public abstract class AbstractFactDataWriter implements CarbonFactDataWriter
{
     notifyDataMapBlockEnd();
     CarbonUtil.closeStreams(this.fileOutputStream, this.fileChannel);
     if (!enableDirectlyWriteData2Hdfs) {
-      if (copyInCurrentThread) {
-        CarbonUtil.copyCarbonDataFileToCarbonStorePath(carbonDataFileTempPath,
-            model.getCarbonDataDirectoryPath(), fileSizeInBytes);
-      } else {
-        executorServiceSubmitList.add(executorService.submit(
-            new CompleteHdfsBackendThread(carbonDataFileTempPath)));
+      try {
+        if (copyInCurrentThread) {
+          CarbonUtil.copyCarbonDataFileToCarbonStorePath(carbonDataFileTempPath,
+              model.getCarbonDataDirectoryPath(), fileSizeInBytes);
+          FileFactory
+              .deleteFile(carbonDataFileTempPath, FileFactory.getFileType(carbonDataFileTempPath));
+        } else {
+          executorServiceSubmitList
+              .add(executorService.submit(new CompleteHdfsBackendThread(carbonDataFileTempPath)));
+        }
+      } catch (IOException e) {
+        LOGGER.error("Failed to delete carbondata file from temp location" + e.getMessage());
       }
     }
   }
@@ -405,6 +411,7 @@ public abstract class AbstractFactDataWriter implements CarbonFactDataWriter
{
       CarbonUtil
           .copyCarbonDataFileToCarbonStorePath(indexFileName, model.getCarbonDataDirectoryPath(),
               fileSizeInBytes);
+      FileFactory.deleteFile(indexFileName, FileFactory.getFileType(indexFileName));
     }
   }
 
@@ -470,6 +477,7 @@ public abstract class AbstractFactDataWriter implements CarbonFactDataWriter
{
     public Void call() throws Exception {
       CarbonUtil.copyCarbonDataFileToCarbonStorePath(fileName, model.getCarbonDataDirectoryPath(),
           fileSizeInBytes);
+      FileFactory.deleteFile(fileName, FileFactory.getFileType(fileName));
       return null;
     }
   }


Mime
View raw message