|
@@ -20,7 +20,6 @@ package org.apache.hadoop.hdfs.server.namenode;
|
|
|
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_NAMENODE_CORRUPT_BLOCK_DELETE_IMMEDIATELY_ENABLED;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_NAMENODE_STALE_DATANODE_INTERVAL_KEY;
|
|
|
-import static org.apache.hadoop.hdfs.MiniDFSCluster.HDFS_MINIDFS_BASEDIR;
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
import static org.junit.Assert.assertFalse;
|
|
|
import static org.junit.Assert.assertNotNull;
|
|
@@ -123,7 +122,9 @@ import org.junit.AfterClass;
|
|
|
import org.junit.Assert;
|
|
|
import org.junit.Before;
|
|
|
import org.junit.BeforeClass;
|
|
|
+import org.junit.Rule;
|
|
|
import org.junit.Test;
|
|
|
+import org.junit.rules.TemporaryFolder;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
/**
|
|
@@ -176,6 +177,9 @@ public class TestFsck {
|
|
|
return bStream.toString();
|
|
|
}
|
|
|
|
|
|
+ @Rule
|
|
|
+ public TemporaryFolder baseDir = new TemporaryFolder();
|
|
|
+
|
|
|
private MiniDFSCluster cluster = null;
|
|
|
private Configuration conf = null;
|
|
|
|
|
@@ -217,8 +221,7 @@ public class TestFsck {
|
|
|
conf.setLong(DFSConfigKeys.DFS_NAMENODE_ACCESSTIME_PRECISION_KEY,
|
|
|
precision);
|
|
|
conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 10000L);
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(4).build();
|
|
|
fs = cluster.getFileSystem();
|
|
|
final String fileName = "/srcdat";
|
|
@@ -235,7 +238,7 @@ public class TestFsck {
|
|
|
shutdownCluster();
|
|
|
|
|
|
// restart the cluster; bring up namenode but not the data nodes
|
|
|
- cluster = new MiniDFSCluster.Builder(conf)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(0).format(false).build();
|
|
|
outStr = runFsck(conf, 1, true, "/");
|
|
|
// expect the result is corrupt
|
|
@@ -282,8 +285,7 @@ public class TestFsck {
|
|
|
setNumFiles(20).build();
|
|
|
FileSystem fs = null;
|
|
|
conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 10000L);
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(4).build();
|
|
|
fs = cluster.getFileSystem();
|
|
|
util.createFiles(fs, "/srcdat");
|
|
@@ -302,8 +304,7 @@ public class TestFsck {
|
|
|
conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 10000L);
|
|
|
|
|
|
// Create a cluster with the current user, write some files
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(4).build();
|
|
|
final MiniDFSCluster c2 = cluster;
|
|
|
final String dir = "/dfsck";
|
|
@@ -350,8 +351,7 @@ public class TestFsck {
|
|
|
DFSTestUtil util = new DFSTestUtil("TestFsck", 5, 3,
|
|
|
(5 * dfsBlockSize) + (dfsBlockSize - 1), 5 * dfsBlockSize);
|
|
|
FileSystem fs = null;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(numDatanodes).build();
|
|
|
String topDir = "/srcdat";
|
|
|
fs = cluster.getFileSystem();
|
|
@@ -558,8 +558,7 @@ public class TestFsck {
|
|
|
FileSystem fs = null;
|
|
|
conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 10000L);
|
|
|
conf.setInt(DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY, 1);
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(4).build();
|
|
|
String topDir = "/srcdat";
|
|
|
fs = cluster.getFileSystem();
|
|
@@ -624,8 +623,7 @@ public class TestFsck {
|
|
|
setNumFiles(4).build();
|
|
|
FileSystem fs = null;
|
|
|
conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 10000L);
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(4).build();
|
|
|
String topDir = "/srcdat";
|
|
|
String randomString = "HADOOP ";
|
|
@@ -679,8 +677,7 @@ public class TestFsck {
|
|
|
final int numAllUnits = dataBlocks + ecPolicy.getNumParityUnits();
|
|
|
int blockSize = 2 * cellSize;
|
|
|
conf.setLong(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, blockSize);
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir).numDataNodes(
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot()).numDataNodes(
|
|
|
numAllUnits + 1).build();
|
|
|
String topDir = "/myDir";
|
|
|
cluster.waitActive();
|
|
@@ -771,8 +768,7 @@ public class TestFsck {
|
|
|
String outStr = null;
|
|
|
short factor = 1;
|
|
|
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(1).build();
|
|
|
cluster.waitActive();
|
|
|
fs = cluster.getFileSystem();
|
|
@@ -844,8 +840,7 @@ public class TestFsck {
|
|
|
Random random = new Random();
|
|
|
String outStr = null;
|
|
|
short factor = 1;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(2).build();
|
|
|
cluster.waitActive();
|
|
|
fs = cluster.getFileSystem();
|
|
@@ -918,8 +913,7 @@ public class TestFsck {
|
|
|
conf.setInt(DFSConfigKeys.DFS_REPLICATION_KEY, 1);
|
|
|
|
|
|
DistributedFileSystem dfs;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(numDn).hosts(hosts).racks(racks).build();
|
|
|
cluster.waitClusterUp();
|
|
|
dfs = cluster.getFileSystem();
|
|
@@ -1065,8 +1059,7 @@ public class TestFsck {
|
|
|
@Test
|
|
|
public void testFsckError() throws Exception {
|
|
|
// bring up a one-node cluster
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir).build();
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot()).build();
|
|
|
String fileName = "/test.txt";
|
|
|
Path filePath = new Path(fileName);
|
|
|
FileSystem fs = cluster.getFileSystem();
|
|
@@ -1098,8 +1091,7 @@ public class TestFsck {
|
|
|
conf.setInt(DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY, 1);
|
|
|
FileSystem fs = null;
|
|
|
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir).build();
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot()).build();
|
|
|
cluster.waitActive();
|
|
|
fs = cluster.getFileSystem();
|
|
|
DFSTestUtil util = new DFSTestUtil.Builder().
|
|
@@ -1158,8 +1150,7 @@ public class TestFsck {
|
|
|
@Test
|
|
|
public void testToCheckTheFsckCommandOnIllegalArguments() throws Exception {
|
|
|
// bring up a one-node cluster
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir).build();
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot()).build();
|
|
|
String fileName = "/test.txt";
|
|
|
Path filePath = new Path(fileName);
|
|
|
FileSystem fs = cluster.getFileSystem();
|
|
@@ -1203,8 +1194,7 @@ public class TestFsck {
|
|
|
DistributedFileSystem dfs = null;
|
|
|
|
|
|
// Startup a minicluster
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(numReplicas).build();
|
|
|
assertNotNull("Failed Cluster Creation", cluster);
|
|
|
cluster.waitClusterUp();
|
|
@@ -1265,8 +1255,7 @@ public class TestFsck {
|
|
|
DistributedFileSystem dfs = null;
|
|
|
|
|
|
// Startup a minicluster
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(numDn).hosts(hosts).racks(racks).build();
|
|
|
assertNotNull("Failed Cluster Creation", cluster);
|
|
|
cluster.waitClusterUp();
|
|
@@ -1374,8 +1363,7 @@ public class TestFsck {
|
|
|
conf.setLong(DFSConfigKeys.DFS_NAMENODE_ACCESSTIME_PRECISION_KEY,
|
|
|
precision);
|
|
|
conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 10000L);
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(4).build();
|
|
|
fs = cluster.getFileSystem();
|
|
|
final String fileName = "/srcdat";
|
|
@@ -1402,8 +1390,7 @@ public class TestFsck {
|
|
|
*/
|
|
|
@Test
|
|
|
public void testFsckForSnapshotFiles() throws Exception {
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir).numDataNodes(1)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot()).numDataNodes(1)
|
|
|
.build();
|
|
|
String runFsck = runFsck(conf, 0, true, "/", "-includeSnapshots",
|
|
|
"-files");
|
|
@@ -1438,8 +1425,7 @@ public class TestFsck {
|
|
|
conf.setInt(DFSConfigKeys.DFS_REPLICATION_KEY, 2);
|
|
|
|
|
|
DistributedFileSystem dfs = null;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(numDn).hosts(hosts).racks(racks).build();
|
|
|
|
|
|
assertNotNull("Failed Cluster Creation", cluster);
|
|
@@ -1493,8 +1479,7 @@ public class TestFsck {
|
|
|
conf.setInt(DFSConfigKeys.DFS_REPLICATION_KEY, 2);
|
|
|
|
|
|
DistributedFileSystem dfs;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(numDn).hosts(hosts).racks(racks).build();
|
|
|
|
|
|
assertNotNull("Failed Cluster Creation", cluster);
|
|
@@ -1578,8 +1563,7 @@ public class TestFsck {
|
|
|
replFactor);
|
|
|
|
|
|
DistributedFileSystem dfs;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(numDn)
|
|
|
.hosts(hosts)
|
|
|
.racks(racks)
|
|
@@ -1785,8 +1769,7 @@ public class TestFsck {
|
|
|
conf.setInt(DFSConfigKeys.DFS_REPLICATION_KEY, 1);
|
|
|
|
|
|
DistributedFileSystem dfs = null;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(numDn).hosts(hosts).racks(racks).build();
|
|
|
|
|
|
assertNotNull("Failed Cluster Creation", cluster);
|
|
@@ -1899,8 +1882,7 @@ public class TestFsck {
|
|
|
*/
|
|
|
@Test
|
|
|
public void testStoragePoliciesCK() throws Exception {
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(3)
|
|
|
.storageTypes(
|
|
|
new StorageType[] {StorageType.DISK, StorageType.ARCHIVE})
|
|
@@ -1943,8 +1925,7 @@ public class TestFsck {
|
|
|
conf.setInt(DFSConfigKeys.DFS_REPLICATION_KEY, 1);
|
|
|
|
|
|
DistributedFileSystem dfs;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(numDn).hosts(hosts).racks(racks).build();
|
|
|
|
|
|
assertNotNull("Failed Cluster Creation", cluster);
|
|
@@ -2025,8 +2006,7 @@ public class TestFsck {
|
|
|
replFactor);
|
|
|
|
|
|
DistributedFileSystem dfs;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(numDn)
|
|
|
.hosts(hosts)
|
|
|
.racks(racks)
|
|
@@ -2134,8 +2114,7 @@ public class TestFsck {
|
|
|
int parityBlocks =
|
|
|
StripedFileTestUtil.getDefaultECPolicy().getNumParityUnits();
|
|
|
int totalSize = dataBlocks + parityBlocks;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(totalSize).build();
|
|
|
fs = cluster.getFileSystem();
|
|
|
fs.enableErasureCodingPolicy(
|
|
@@ -2170,7 +2149,7 @@ public class TestFsck {
|
|
|
shutdownCluster();
|
|
|
|
|
|
// restart the cluster; bring up namenode but not the data nodes
|
|
|
- cluster = new MiniDFSCluster.Builder(conf)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(0).format(false).build();
|
|
|
outStr = runFsck(conf, 1, true, "/", "-files", "-blocks");
|
|
|
// expect the result is corrupt
|
|
@@ -2202,8 +2181,7 @@ public class TestFsck {
|
|
|
|
|
|
int numFiles = 3;
|
|
|
int numSnapshots = 0;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir).build();
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot()).build();
|
|
|
cluster.waitActive();
|
|
|
hdfs = cluster.getFileSystem();
|
|
|
DFSTestUtil util = new DFSTestUtil.Builder().
|
|
@@ -2297,8 +2275,7 @@ public class TestFsck {
|
|
|
conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 1000L);
|
|
|
conf.setInt(DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY, 1);
|
|
|
conf.setInt(DFSConfigKeys.DFS_REPLICATION_KEY, replication);
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir).build();
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot()).build();
|
|
|
DistributedFileSystem dfs = cluster.getFileSystem();
|
|
|
cluster.waitActive();
|
|
|
|
|
@@ -2393,7 +2370,6 @@ public class TestFsck {
|
|
|
HostsFileWriter hostsFileWriter = new HostsFileWriter();
|
|
|
conf.setLong(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, blockSize);
|
|
|
conf.setInt(DFSConfigKeys.DFS_REPLICATION_KEY, replFactor);
|
|
|
- conf.set(HDFS_MINIDFS_BASEDIR, GenericTestUtils.getRandomizedTempPath());
|
|
|
if (defineUpgradeDomain) {
|
|
|
conf.setClass(DFSConfigKeys.DFS_NAMENODE_HOSTS_PROVIDER_CLASSNAME_KEY,
|
|
|
CombinedHostFileManager.class, HostConfigManager.class);
|
|
@@ -2401,7 +2377,7 @@ public class TestFsck {
|
|
|
}
|
|
|
|
|
|
DistributedFileSystem dfs;
|
|
|
- cluster = new MiniDFSCluster.Builder(conf).numDataNodes(numDN).
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot()).numDataNodes(numDN).
|
|
|
hosts(hosts).racks(racks).build();
|
|
|
cluster.waitClusterUp();
|
|
|
dfs = cluster.getFileSystem();
|
|
@@ -2445,8 +2421,7 @@ public class TestFsck {
|
|
|
StripedFileTestUtil.getDefaultECPolicy().getNumParityUnits();
|
|
|
int cellSize = StripedFileTestUtil.getDefaultECPolicy().getCellSize();
|
|
|
int totalSize = dataBlocks + parityBlocks;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(totalSize).build();
|
|
|
fs = cluster.getFileSystem();
|
|
|
fs.enableErasureCodingPolicy(
|
|
@@ -2517,8 +2492,7 @@ public class TestFsck {
|
|
|
StripedFileTestUtil.getDefaultECPolicy().getNumParityUnits();
|
|
|
int cellSize = StripedFileTestUtil.getDefaultECPolicy().getCellSize();
|
|
|
int totalSize = dataBlocks + parityBlocks;
|
|
|
- File builderBaseDir = new File(GenericTestUtils.getRandomizedTempPath());
|
|
|
- cluster = new MiniDFSCluster.Builder(conf, builderBaseDir)
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.numDataNodes(totalSize).build();
|
|
|
fs = cluster.getFileSystem();
|
|
|
fs.enableErasureCodingPolicy(
|
|
@@ -2641,8 +2615,7 @@ public class TestFsck {
|
|
|
@Test(timeout = 300000)
|
|
|
public void testFsckCorruptWhenOneReplicaIsCorrupt()
|
|
|
throws Exception {
|
|
|
- try (MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf,
|
|
|
- new File(GenericTestUtils.getRandomizedTempPath()))
|
|
|
+ try (MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot())
|
|
|
.nnTopology(MiniDFSNNTopology.simpleHATopology()).numDataNodes(2)
|
|
|
.build()) {
|
|
|
cluster.waitActive();
|
|
@@ -2671,7 +2644,7 @@ public class TestFsck {
|
|
|
|
|
|
@Test
|
|
|
public void testFsckNonPrivilegedListCorrupt() throws Exception {
|
|
|
- cluster = new MiniDFSCluster.Builder(conf).numDataNodes(4).build();
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf, baseDir.getRoot()).numDataNodes(4).build();
|
|
|
UserGroupInformation ugi = UserGroupInformation.createUserForTesting("systest", new String[]{""});
|
|
|
ugi.doAs(new PrivilegedExceptionAction<Void>() {
|
|
|
@Override
|