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 <[email protected]> Reviewed-by: Murtadha Hubail <[email protected]> --- 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 <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]> Gerrit-Reviewer: abdullah alamoudi <[email protected]>
