HDFS-3235. MiniDFSClusterManager doesn't correctly support -format option. Contributed by Henry Robinson.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1311556 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Aaron Myers 2012-04-10 02:25:40 +00:00
parent 9597c81f35
commit 53dc8546d4
2 changed files with 12 additions and 2 deletions

View File

@ -121,6 +121,9 @@ Trunk (unreleased changes)
HDFS-3119. Overreplicated block is not deleted even after the replication HDFS-3119. Overreplicated block is not deleted even after the replication
factor is reduced after sync follwed by closing that file. (Ashish Singhi factor is reduced after sync follwed by closing that file. (Ashish Singhi
via umamahesh) via umamahesh)
HDFS-3235. MiniDFSClusterManager doesn't correctly support -format option.
(Henry Robinson via atm)
Release 2.0.0 - UNRELEASED Release 2.0.0 - UNRELEASED

View File

@ -68,6 +68,7 @@ public class MiniDFSClusterManager {
private StartupOption dfsOpts; private StartupOption dfsOpts;
private String writeConfig; private String writeConfig;
private Configuration conf; private Configuration conf;
private boolean format;
private static final long SLEEP_INTERVAL_MS = 1000 * 60; private static final long SLEEP_INTERVAL_MS = 1000 * 60;
@ -138,6 +139,7 @@ public class MiniDFSClusterManager {
dfs = new MiniDFSCluster.Builder(conf).nameNodePort(nameNodePort) dfs = new MiniDFSCluster.Builder(conf).nameNodePort(nameNodePort)
.numDataNodes(numDataNodes) .numDataNodes(numDataNodes)
.startupOption(dfsOpts) .startupOption(dfsOpts)
.format(format)
.build(); .build();
dfs.waitActive(); dfs.waitActive();
@ -196,8 +198,13 @@ public class MiniDFSClusterManager {
// HDFS // HDFS
numDataNodes = intArgument(cli, "datanodes", 1); numDataNodes = intArgument(cli, "datanodes", 1);
nameNodePort = intArgument(cli, "nnport", 0); nameNodePort = intArgument(cli, "nnport", 0);
dfsOpts = cli.hasOption("format") ? if (cli.hasOption("format")) {
StartupOption.FORMAT : StartupOption.REGULAR; dfsOpts = StartupOption.FORMAT;
format = true;
} else {
dfsOpts = StartupOption.REGULAR;
format = false;
}
// Runner // Runner
writeDetails = cli.getOptionValue("writeDetails"); writeDetails = cli.getOptionValue("writeDetails");