HDFS-2580. NameNode#main(...) can make use of GenericOptionsParser. Contributed by harsh. (harsh)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1379828 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Harsh J 2012-09-01 19:22:11 +00:00
parent 50222ff529
commit 54e612bfb9
2 changed files with 7 additions and 0 deletions

View File

@ -131,6 +131,8 @@ Trunk (unreleased changes)
HDFS-3851. DFSOutputStream class code cleanup. (Jing Zhao via suresh)
HDFS-2580. NameNode#main(...) can make use of GenericOptionsParser. (harsh)
OPTIMIZATIONS
BUG FIXES

View File

@ -73,6 +73,7 @@ import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authorize.RefreshAuthorizationPolicyProtocol;
import org.apache.hadoop.tools.GetUserMappingsProtocol;
import org.apache.hadoop.util.ExitUtil.ExitException;
import org.apache.hadoop.util.GenericOptionsParser;
import org.apache.hadoop.util.ServicePlugin;
import org.apache.hadoop.util.StringUtils;
@ -1056,6 +1057,10 @@ public class NameNode {
throws IOException {
if (conf == null)
conf = new HdfsConfiguration();
// Parse out some generic args into Configuration.
GenericOptionsParser hParser = new GenericOptionsParser(conf, argv);
argv = hParser.getRemainingArgs();
// Parse the rest, NN specific args.
StartupOption startOpt = parseArguments(argv);
if (startOpt == null) {
printUsage(System.err);