Fix path separators in test cases
diff --git a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/genomix/hadoop/graphclean/mergepaths/h4/MergePathsH4.java b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/genomix/hadoop/graphclean/mergepaths/h4/MergePathsH4.java
index 926afe1..c8cfe6d 100644
--- a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/genomix/hadoop/graphclean/mergepaths/h4/MergePathsH4.java
+++ b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/genomix/hadoop/graphclean/mergepaths/h4/MergePathsH4.java
@@ -364,9 +364,15 @@
RunningJob job = JobClient.runJob(conf);
// move the tmp outputs to the arg-spec'ed dirs
- dfs.rename(new Path(outputPath + File.pathSeparator + MergePathsH4Reducer.TO_MERGE_OUTPUT), new Path(toMergeOutput));
- dfs.rename(new Path(outputPath + File.pathSeparator + MergePathsH4Reducer.COMPLETE_OUTPUT), new Path(completeOutput));
- dfs.rename(new Path(outputPath + File.pathSeparator + MergePathsH4Reducer.UPDATES_OUTPUT), new Path(updatesOutput));
+ if (!dfs.rename(new Path(outputPath + File.separator + MergePathsH4Reducer.TO_MERGE_OUTPUT), new Path(toMergeOutput))) {
+ dfs.mkdirs(new Path(toMergeOutput));
+ }
+ if (!dfs.rename(new Path(outputPath + File.separator + MergePathsH4Reducer.COMPLETE_OUTPUT), new Path(completeOutput))) {
+ dfs.mkdirs(new Path(completeOutput));
+ }
+ if (!dfs.rename(new Path(outputPath + File.separator + MergePathsH4Reducer.UPDATES_OUTPUT), new Path(updatesOutput))) {
+ dfs.mkdirs(new Path(updatesOutput));
+ }
return job;
}
diff --git a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/genomix/hadoop/pmcommon/PathNodeInitial.java b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/genomix/hadoop/pmcommon/PathNodeInitial.java
index 2974d4c..71d2295 100644
--- a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/genomix/hadoop/pmcommon/PathNodeInitial.java
+++ b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/genomix/hadoop/pmcommon/PathNodeInitial.java
@@ -240,7 +240,7 @@
conf.setJobName("PathNodeInitial " + inputPath);
FileInputFormat.addInputPaths(conf, inputPath);
- Path outputPath = new Path(inputPath + ".initialMerge.tmp");
+ Path outputPath = new Path(inputPath.replaceAll("/$", "") + ".initialMerge.tmp");
FileOutputFormat.setOutputPath(conf, outputPath);
conf.setInputFormat(SequenceFileInputFormat.class);
@@ -264,8 +264,8 @@
RunningJob job = JobClient.runJob(conf);
// move the tmp outputs to the arg-spec'ed dirs
- dfs.rename(new Path(outputPath + File.pathSeparator + TO_MERGE_OUTPUT), new Path(toMergeOutput));
- dfs.rename(new Path(outputPath + File.pathSeparator + COMPLETE_OUTPUT), new Path(completeOutput));
+ dfs.rename(new Path(outputPath + File.separator + TO_MERGE_OUTPUT), new Path(toMergeOutput));
+ dfs.rename(new Path(outputPath + File.separator + COMPLETE_OUTPUT), new Path(completeOutput));
return job;
}