HDFS-13650. Randomize baseDir for MiniDFSCluster in TestDFSStripedInputStream and TestDFSStripedInputStreamWithRandomECPolicy. Contributed by Anbang Hu.
This commit is contained in:
parent
16316b6011
commit
8d31ddcfeb
@ -105,7 +105,13 @@ public void setup() throws IOException {
|
|||||||
CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY,
|
CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY,
|
||||||
NativeRSRawErasureCoderFactory.CODER_NAME);
|
NativeRSRawErasureCoderFactory.CODER_NAME);
|
||||||
}
|
}
|
||||||
|
conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR,
|
||||||
|
GenericTestUtils.getRandomizedTempPath());
|
||||||
SimulatedFSDataset.setFactory(conf);
|
SimulatedFSDataset.setFactory(conf);
|
||||||
|
startUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startUp() throws IOException {
|
||||||
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(
|
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(
|
||||||
dataBlocks + parityBlocks).build();
|
dataBlocks + parityBlocks).build();
|
||||||
cluster.waitActive();
|
cluster.waitActive();
|
||||||
@ -326,7 +332,7 @@ private void testStatefulRead(boolean useByteBuffer,
|
|||||||
if (cellMisalignPacket) {
|
if (cellMisalignPacket) {
|
||||||
conf.setInt(IO_FILE_BUFFER_SIZE_KEY, IO_FILE_BUFFER_SIZE_DEFAULT + 1);
|
conf.setInt(IO_FILE_BUFFER_SIZE_KEY, IO_FILE_BUFFER_SIZE_DEFAULT + 1);
|
||||||
tearDown();
|
tearDown();
|
||||||
setup();
|
startUp();
|
||||||
}
|
}
|
||||||
DFSTestUtil.createStripedFile(cluster, filePath, null, numBlocks,
|
DFSTestUtil.createStripedFile(cluster, filePath, null, numBlocks,
|
||||||
stripesPerBlock, false, ecPolicy);
|
stripesPerBlock, false, ecPolicy);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user