|
@@ -94,7 +94,7 @@ public class TestDFSShell extends TestCase {
|
|
|
|
|
|
public void testZeroSizeFile() throws IOException {
|
|
|
Configuration conf = new HdfsConfiguration();
|
|
|
- MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
FileSystem fs = cluster.getFileSystem();
|
|
|
assertTrue("Not a HDFS: "+fs.getUri(),
|
|
|
fs instanceof DistributedFileSystem);
|
|
@@ -136,7 +136,7 @@ public class TestDFSShell extends TestCase {
|
|
|
|
|
|
public void testRecrusiveRm() throws IOException {
|
|
|
Configuration conf = new HdfsConfiguration();
|
|
|
- MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
FileSystem fs = cluster.getFileSystem();
|
|
|
assertTrue("Not a HDFS: " + fs.getUri(),
|
|
|
fs instanceof DistributedFileSystem);
|
|
@@ -161,7 +161,7 @@ public class TestDFSShell extends TestCase {
|
|
|
|
|
|
public void testDu() throws IOException {
|
|
|
Configuration conf = new HdfsConfiguration();
|
|
|
- MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
FileSystem fs = cluster.getFileSystem();
|
|
|
assertTrue("Not a HDFS: "+fs.getUri(),
|
|
|
fs instanceof DistributedFileSystem);
|
|
@@ -210,7 +210,7 @@ public class TestDFSShell extends TestCase {
|
|
|
}
|
|
|
public void testPut() throws IOException {
|
|
|
Configuration conf = new HdfsConfiguration();
|
|
|
- MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
FileSystem fs = cluster.getFileSystem();
|
|
|
assertTrue("Not a HDFS: "+fs.getUri(),
|
|
|
fs instanceof DistributedFileSystem);
|
|
@@ -309,7 +309,7 @@ public class TestDFSShell extends TestCase {
|
|
|
MiniDFSCluster cluster = null;
|
|
|
PrintStream bak = null;
|
|
|
try {
|
|
|
- cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
FileSystem srcFs = cluster.getFileSystem();
|
|
|
Path root = new Path("/nonexistentfile");
|
|
|
bak = System.err;
|
|
@@ -453,11 +453,11 @@ public class TestDFSShell extends TestCase {
|
|
|
MiniDFSCluster dstCluster = null;
|
|
|
String bak = System.getProperty("test.build.data");
|
|
|
try{
|
|
|
- srcCluster = new MiniDFSCluster(srcConf, 2, true, null);
|
|
|
+ srcCluster = new MiniDFSCluster.Builder(srcConf).numDataNodes(2).build();
|
|
|
File nameDir = new File(new File(bak), "dfs_tmp_uri/");
|
|
|
nameDir.mkdirs();
|
|
|
System.setProperty("test.build.data", nameDir.toString());
|
|
|
- dstCluster = new MiniDFSCluster(dstConf, 2, true, null);
|
|
|
+ dstCluster = new MiniDFSCluster.Builder(dstConf).numDataNodes(2).build();
|
|
|
FileSystem srcFs = srcCluster.getFileSystem();
|
|
|
FileSystem dstFs = dstCluster.getFileSystem();
|
|
|
FsShell shell = new FsShell();
|
|
@@ -542,7 +542,7 @@ public class TestDFSShell extends TestCase {
|
|
|
Configuration conf = new HdfsConfiguration();
|
|
|
MiniDFSCluster cluster = null;
|
|
|
try {
|
|
|
- cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
final FileSystem dfs = cluster.getFileSystem();
|
|
|
textTest(new Path("/texttest").makeQualified(dfs.getUri(),
|
|
|
dfs.getWorkingDirectory()), conf);
|
|
@@ -596,7 +596,7 @@ public class TestDFSShell extends TestCase {
|
|
|
|
|
|
public void testCopyToLocal() throws IOException {
|
|
|
Configuration conf = new HdfsConfiguration();
|
|
|
- MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
FileSystem fs = cluster.getFileSystem();
|
|
|
assertTrue("Not a HDFS: "+fs.getUri(),
|
|
|
fs instanceof DistributedFileSystem);
|
|
@@ -693,7 +693,7 @@ public class TestDFSShell extends TestCase {
|
|
|
|
|
|
public void testCount() throws Exception {
|
|
|
Configuration conf = new HdfsConfiguration();
|
|
|
- MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
DistributedFileSystem dfs = (DistributedFileSystem)cluster.getFileSystem();
|
|
|
FsShell shell = new FsShell();
|
|
|
shell.setConf(conf);
|
|
@@ -859,7 +859,7 @@ public class TestDFSShell extends TestCase {
|
|
|
conf.set(DFSConfigKeys.DFS_PERMISSIONS_ENABLED_KEY, "true");
|
|
|
|
|
|
//test chmod on DFS
|
|
|
- MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
fs = cluster.getFileSystem();
|
|
|
testChmod(conf, fs, "/tmp/chmodTest");
|
|
|
|
|
@@ -917,7 +917,7 @@ public class TestDFSShell extends TestCase {
|
|
|
Configuration conf = new HdfsConfiguration();
|
|
|
/* This tests some properties of ChecksumFileSystem as well.
|
|
|
* Make sure that we create ChecksumDFS */
|
|
|
- MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
FileSystem fs = cluster.getFileSystem();
|
|
|
assertTrue("Not a HDFS: "+fs.getUri(),
|
|
|
fs instanceof DistributedFileSystem);
|
|
@@ -1140,7 +1140,7 @@ public class TestDFSShell extends TestCase {
|
|
|
PrintStream bak = null;
|
|
|
try {
|
|
|
final Configuration conf = new HdfsConfiguration();
|
|
|
- dfs = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ dfs = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
FileSystem fs = dfs.getFileSystem();
|
|
|
Path p = new Path("/foo");
|
|
|
fs.mkdirs(p);
|
|
@@ -1179,7 +1179,7 @@ public class TestDFSShell extends TestCase {
|
|
|
public void testGet() throws IOException {
|
|
|
DFSTestUtil.setLogLevel2All(FSInputChecker.LOG);
|
|
|
final Configuration conf = new HdfsConfiguration();
|
|
|
- MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
DistributedFileSystem dfs = (DistributedFileSystem)cluster.getFileSystem();
|
|
|
|
|
|
try {
|
|
@@ -1237,7 +1237,7 @@ public class TestDFSShell extends TestCase {
|
|
|
|
|
|
public void testLsr() throws Exception {
|
|
|
final Configuration conf = new HdfsConfiguration();
|
|
|
- MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
|
|
|
+ MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
|
|
|
DistributedFileSystem dfs = (DistributedFileSystem)cluster.getFileSystem();
|
|
|
|
|
|
try {
|