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: Fix Remove File Operator
Date Thu, 25 Feb 2016 07:10:22 GMT
Repository: incubator-asterixdb-hyracks
Updated Branches:
  refs/heads/master d7135572e -> c20aa64af


Fix Remove File Operator

The operator didn't get the correct path of the folder to be
deleted. After the fix, the operator gets the correct path
from the IO manager.

Change-Id: I5910409d79e9c1f8e7192a1050b2be0f823e912f
Reviewed-on: https://asterix-gerrit.ics.uci.edu/659
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/c20aa64a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/tree/c20aa64a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/diff/c20aa64a

Branch: refs/heads/master
Commit: c20aa64af7e850d6c2c791d3a2aa05b8cb634759
Parents: d713557
Author: Abdullah Alamoudi <bamousaa@gmail.com>
Authored: Wed Feb 24 18:18:18 2016 +0300
Committer: abdullah alamoudi <bamousaa@gmail.com>
Committed: Wed Feb 24 23:05:17 2016 -0800

----------------------------------------------------------------------
 .../dataflow/std/file/FileRemoveOperatorDescriptor.java       | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/c20aa64a/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 6e274d5..cf2008c 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
@@ -23,13 +23,13 @@ import java.io.File;
 import java.io.IOException;
 
 import org.apache.commons.io.FileUtils;
-
 import org.apache.hyracks.api.comm.IFrameWriter;
 import org.apache.hyracks.api.context.IHyracksTaskContext;
 import org.apache.hyracks.api.dataflow.IOperatorNodePushable;
 import org.apache.hyracks.api.dataflow.value.IRecordDescriptorProvider;
 import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.api.io.IIOManager;
 import org.apache.hyracks.api.job.IOperatorDescriptorRegistry;
 import org.apache.hyracks.dataflow.std.base.AbstractOperatorNodePushable;
 import org.apache.hyracks.dataflow.std.base.AbstractSingleActivityOperatorDescriptor;
@@ -49,6 +49,9 @@ public class FileRemoveOperatorDescriptor extends AbstractSingleActivityOperator
     public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,
             IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions)
throws HyracksDataException {
         final FileSplit split = fileSplitProvider.getFileSplits()[partition];
+        final String path = split.getLocalFile().getFile().getPath();
+        final int deviceId = split.getIODeviceId();
+        final IIOManager ioManager = ctx.getIOManager();
         return new AbstractOperatorNodePushable() {
 
             @Override
@@ -58,7 +61,7 @@ public class FileRemoveOperatorDescriptor extends AbstractSingleActivityOperator
 
             @Override
             public void initialize() throws HyracksDataException {
-                File f = split.getLocalFile().getFile();
+                File f = ioManager.getAbsoluteFileRef(deviceId, path).getFile();
                 try {
                     FileUtils.deleteDirectory(f);
                 } catch (IOException e) {


Mime
View raw message