asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "abdullah alamoudi (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in hyracks[master]: Fix Remove File Operator
Date Thu, 25 Feb 2016 07:05:17 GMT
abdullah alamoudi has submitted this change and it was merged.

Change subject: Fix Remove File Operator
......................................................................


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>
---
M hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/file/FileRemoveOperatorDescriptor.java
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Murtadha Hubail: Looks good to me, approved
  Jenkins: Verified



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.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 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 @@
 
             @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) {

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/659
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5910409d79e9c1f8e7192a1050b2be0f823e912f
Gerrit-PatchSet: 2
Gerrit-Project: hyracks
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <bamousaa@gmail.com>
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hubailmor@gmail.com>
Gerrit-Reviewer: abdullah alamoudi <bamousaa@gmail.com>

Mime
View raw message