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

(svn merge -c 1311556 from trunk)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1348247 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Todd Lipcon 2012-06-08 21:19:17 +00:00
parent e6c0425996
commit 5b43977af1
2 changed files with 12 additions and 2 deletions

View File

@ -173,6 +173,9 @@ Release 2.0.1-alpha - UNRELEASED
HDFS-2914. HA: Standby should not enter safemode when resources are low. (Vinay via atm)
HDFS-3235. MiniDFSClusterManager doesn't correctly support -format option.
(Henry Robinson via atm)
BREAKDOWN OF HDFS-3042 SUBTASKS
HDFS-2185. HDFS portion of ZK-based FailoverController (todd)

View File

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