|
@@ -21,12 +21,14 @@ import java.io.File;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
import java.io.RandomAccessFile;
|
|
import java.io.RandomAccessFile;
|
|
|
|
+import java.util.EnumSet;
|
|
import java.util.Random;
|
|
import java.util.Random;
|
|
|
|
|
|
import junit.framework.TestCase;
|
|
import junit.framework.TestCase;
|
|
|
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.fs.ChecksumException;
|
|
import org.apache.hadoop.fs.ChecksumException;
|
|
|
|
+import org.apache.hadoop.fs.CreateFlag;
|
|
import org.apache.hadoop.fs.FSDataInputStream;
|
|
import org.apache.hadoop.fs.FSDataInputStream;
|
|
import org.apache.hadoop.fs.FSDataOutputStream;
|
|
import org.apache.hadoop.fs.FSDataOutputStream;
|
|
import org.apache.hadoop.fs.FileSystem;
|
|
import org.apache.hadoop.fs.FileSystem;
|
|
@@ -54,7 +56,7 @@ public class TestFSInputChecker extends TestCase {
|
|
private void writeFile(FileSystem fileSys, Path name) throws IOException {
|
|
private void writeFile(FileSystem fileSys, Path name) throws IOException {
|
|
// create and write a file that contains three blocks of data
|
|
// create and write a file that contains three blocks of data
|
|
FSDataOutputStream stm = fileSys.create(name, new FsPermission((short)0777),
|
|
FSDataOutputStream stm = fileSys.create(name, new FsPermission((short)0777),
|
|
- true, fileSys.getConf().getInt("io.file.buffer.size", 4096),
|
|
|
|
|
|
+ EnumSet.of(CreateFlag.OVERWRITE), fileSys.getConf().getInt("io.file.buffer.size", 4096),
|
|
NUM_OF_DATANODES, BLOCK_SIZE, null);
|
|
NUM_OF_DATANODES, BLOCK_SIZE, null);
|
|
stm.write(expected);
|
|
stm.write(expected);
|
|
stm.close();
|
|
stm.close();
|