asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amo...@apache.org
Subject incubator-asterixdb-hyracks git commit: Enable Remove Quietly for Remove Directory Jobs
Date Mon, 04 Apr 2016 08:36:56 GMT
Repository: incubator-asterixdb-hyracks
Updated Branches:
  refs/heads/master 08aa051a3 -> 066103630


Enable Remove Quietly for Remove Directory Jobs

Change-Id: I00a60bf4ac6d64295224c2cebc28fb22f92e77fd
Reviewed-on: https://asterix-gerrit.ics.uci.edu/775
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <hubailmor@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/commit/06610363
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/tree/06610363
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/diff/06610363

Branch: refs/heads/master
Commit: 0661036306c80ee45ed3f60f91ea38af46a64cff
Parents: 08aa051
Author: Abdullah Alamoudi <bamousaa@gmail.com>
Authored: Mon Apr 4 09:45:29 2016 +0300
Committer: abdullah alamoudi <bamousaa@gmail.com>
Committed: Mon Apr 4 01:30:50 2016 -0700

----------------------------------------------------------------------
 .../std/file/FileRemoveOperatorDescriptor.java     | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/06610363/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/file/FileRemoveOperatorDescriptor.java
----------------------------------------------------------------------
diff --git a/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/file/FileRemoveOperatorDescriptor.java
b/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/file/FileRemoveOperatorDescriptor.java
index cf2008c..43b1b34 100644
--- a/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/file/FileRemoveOperatorDescriptor.java
+++ b/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/file/FileRemoveOperatorDescriptor.java
@@ -37,10 +37,13 @@ import org.apache.hyracks.dataflow.std.base.AbstractSingleActivityOperatorDescri
 public class FileRemoveOperatorDescriptor extends AbstractSingleActivityOperatorDescriptor
{
 
     private final IFileSplitProvider fileSplitProvider;
+    private final boolean quietly;
 
-    public FileRemoveOperatorDescriptor(IOperatorDescriptorRegistry spec, IFileSplitProvider
fileSplitProvder) {
+    public FileRemoveOperatorDescriptor(IOperatorDescriptorRegistry spec, IFileSplitProvider
fileSplitProvder,
+            boolean quietly) {
         super(spec, 0, 0);
         this.fileSplitProvider = fileSplitProvder;
+        this.quietly = quietly;
     }
 
     private static final long serialVersionUID = 1L;
@@ -62,10 +65,14 @@ public class FileRemoveOperatorDescriptor extends AbstractSingleActivityOperator
             @Override
             public void initialize() throws HyracksDataException {
                 File f = ioManager.getAbsoluteFileRef(deviceId, path).getFile();
-                try {
-                    FileUtils.deleteDirectory(f);
-                } catch (IOException e) {
-                    throw new HyracksDataException(e);
+                if (quietly) {
+                    FileUtils.deleteQuietly(f);
+                } else {
+                    try {
+                        FileUtils.deleteDirectory(f);
+                    } catch (IOException e) {
+                        throw new HyracksDataException(e);
+                    }
                 }
             }
 


Mime
View raw message