Skip to content

Commit

Permalink
OutputFormat unit test discard existing temp files by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanEwen committed Mar 3, 2014
1 parent 3a63443 commit 8311ebc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import eu.stratosphere.core.fs.FileInputSplit;
import eu.stratosphere.core.fs.FileStatus;
import eu.stratosphere.core.fs.FileSystem;
import eu.stratosphere.core.fs.FileSystem.WriteMode;
import eu.stratosphere.core.fs.Path;
import eu.stratosphere.core.io.InputSplit;
import eu.stratosphere.util.ReflectionUtil;
Expand Down Expand Up @@ -151,6 +152,7 @@ public static <T, F extends FileOutputFormat<? extends T>> F openOutput(
final F outputFormat = ReflectionUtil.newInstance(outputFormatClass);
outputFormat.setOutputFilePath(new Path(path));
outputFormat.setOpenTimeout(0);
outputFormat.setWriteMode(WriteMode.OVERWRITE);

configuration = configuration == null ? new Configuration() : configuration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@
public class SequentialFormatTest {

public class InputSplitSorter implements Comparator<FileInputSplit> {
/*
* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
@Override
public int compare(FileInputSplit o1, FileInputSplit o2) {
int pathOrder = o1.getPath().getName().compareTo(o2.getPath().getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import eu.stratosphere.api.java.record.io.CsvOutputFormat;
import eu.stratosphere.configuration.Configuration;
import eu.stratosphere.core.fs.Path;
import eu.stratosphere.core.fs.FileSystem.WriteMode;
import eu.stratosphere.types.IntValue;
import eu.stratosphere.types.Record;
import eu.stratosphere.types.StringValue;
Expand All @@ -49,6 +50,7 @@ public class CsvOutputFormatTest {
public void setup() throws IOException {
this.tempFile = File.createTempFile("test_output", "tmp");
this.format.setOutputFilePath(new Path(tempFile.toURI()));
this.format.setWriteMode(WriteMode.OVERWRITE);
}

@After
Expand Down

0 comments on commit 8311ebc

Please sign in to comment.