|
@@ -65,6 +65,7 @@ public class MiniDFSClusterManager {
|
|
private String writeDetails;
|
|
private String writeDetails;
|
|
private int numDataNodes;
|
|
private int numDataNodes;
|
|
private int nameNodePort;
|
|
private int nameNodePort;
|
|
|
|
+ private int nameNodeHttpPort;
|
|
private StartupOption dfsOpts;
|
|
private StartupOption dfsOpts;
|
|
private String writeConfig;
|
|
private String writeConfig;
|
|
private Configuration conf;
|
|
private Configuration conf;
|
|
@@ -84,6 +85,7 @@ public class MiniDFSClusterManager {
|
|
.addOption("cmdport", true,
|
|
.addOption("cmdport", true,
|
|
"Which port to listen on for commands (default 0--we choose)")
|
|
"Which port to listen on for commands (default 0--we choose)")
|
|
.addOption("nnport", true, "NameNode port (default 0--we choose)")
|
|
.addOption("nnport", true, "NameNode port (default 0--we choose)")
|
|
|
|
+ .addOption("httpport", true, "NameNode http port (default 0--we choose)")
|
|
.addOption("namenode", true, "URL of the namenode (default "
|
|
.addOption("namenode", true, "URL of the namenode (default "
|
|
+ "is either the DFS cluster or a temporary dir)")
|
|
+ "is either the DFS cluster or a temporary dir)")
|
|
.addOption(OptionBuilder
|
|
.addOption(OptionBuilder
|
|
@@ -137,6 +139,7 @@ public class MiniDFSClusterManager {
|
|
*/
|
|
*/
|
|
public void start() throws IOException, FileNotFoundException {
|
|
public void start() throws IOException, FileNotFoundException {
|
|
dfs = new MiniDFSCluster.Builder(conf).nameNodePort(nameNodePort)
|
|
dfs = new MiniDFSCluster.Builder(conf).nameNodePort(nameNodePort)
|
|
|
|
+ .nameNodeHttpPort(nameNodeHttpPort)
|
|
.numDataNodes(numDataNodes)
|
|
.numDataNodes(numDataNodes)
|
|
.startupOption(dfsOpts)
|
|
.startupOption(dfsOpts)
|
|
.format(format)
|
|
.format(format)
|
|
@@ -198,6 +201,7 @@ 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);
|
|
|
|
+ nameNodeHttpPort = intArgument(cli, "httpport", 0);
|
|
if (cli.hasOption("format")) {
|
|
if (cli.hasOption("format")) {
|
|
dfsOpts = StartupOption.FORMAT;
|
|
dfsOpts = StartupOption.FORMAT;
|
|
format = true;
|
|
format = true;
|