Hbase 1.2
HMaster的启动采用了ToolRunner:
- 将conf和args封装成GenericOptionsParser对象parser, 根据parser获取toolArgs
- 返回tool.run(toolArgs); 返回tool.run(toolArgs);
@see HMasterCommandLine#run
各种参数检查
if ("start".equals(command)) {
return startMaster();
} else if ("stop".equals(command)) {
return stopMaster();
} else if ("clear".equals(command)) {
return (ZNodeClearer.clear(getConf()) ? 0 : 1);
} else {
usage("Invalid command: " + command);
return 1;
}
@see HMaster#startActiveMasterManager