apex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csi...@apache.org
Subject [1/2] incubator-apex-malhar git commit: Fix removal of vagrant tmp files when output file is in subdirectory
Date Tue, 22 Sep 2015 01:11:35 GMT
Repository: incubator-apex-malhar
Updated Branches:
  refs/heads/devel-3 9194a72c3 -> ffc25e57c


Fix removal of vagrant tmp files when output file is in subdirectory


Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/commit/13997ac8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/tree/13997ac8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/diff/13997ac8

Branch: refs/heads/devel-3
Commit: 13997ac81fdb771db5e9574c5233ef9ae3935d8c
Parents: 9194a72
Author: Darin Nee <darin.nee@gmail.com>
Authored: Mon Sep 21 17:19:07 2015 -0700
Committer: Darin Nee <darin.nee@gmail.com>
Committed: Mon Sep 21 17:19:07 2015 -0700

----------------------------------------------------------------------
 .../com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/13997ac8/library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java
----------------------------------------------------------------------
diff --git a/library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java
b/library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java
index 8339cc1..87e70e9 100644
--- a/library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java
+++ b/library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java
@@ -1168,10 +1168,10 @@ public abstract class AbstractFileOutputOperator<INPUT> extends
BaseOperator imp
     fileNameToTmpName.remove(fileName);
 
     //when writing to tmp files there can be vagrant tmp files which we have to clean
-    FileStatus[] statuses = fs.listStatus(new Path(filePath));
+    FileStatus[] statuses = fs.listStatus(destPath.getParent());
     for (FileStatus status : statuses) {
       String statusName = status.getPath().getName();
-      if (statusName.endsWith(TMP_EXTENSION) && statusName.startsWith(fileName))
{
+      if (statusName.endsWith(TMP_EXTENSION) && statusName.startsWith(destPath.getName()))
{
         //a tmp file has tmp extension always preceded by timestamp
         String actualFileName = statusName.substring(0, statusName.lastIndexOf('.', statusName.lastIndexOf('.')
- 1));
         if (fileName.equals(actualFileName)) {


Mime
View raw message