本文整理汇总了Java中org.apache.hadoop.hbase.ZNodeClearer类的典型用法代码示例。如果您正苦于以下问题:Java ZNodeClearer类的具体用法?Java ZNodeClearer怎么用?Java ZNodeClearer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ZNodeClearer类属于org.apache.hadoop.hbase包,在下文中一共展示了ZNodeClearer类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.apache.hadoop.hbase.ZNodeClearer; //导入依赖的package包/类
public int run(String args[]) throws Exception {
Options opt = new Options();
opt.addOption("minServers", true, "Minimum RegionServers needed to host user tables");
opt.addOption("backup", false, "Do not try to become HMaster until the primary fails");
CommandLine cmd;
try {
cmd = new GnuParser().parse(opt, args);
} catch (ParseException e) {
LOG.error("Could not parse: ", e);
usage(null);
return -1;
}
if (cmd.hasOption("minServers")) {
String val = cmd.getOptionValue("minServers");
getConf().setInt("hbase.regions.server.count.min",
Integer.valueOf(val));
LOG.debug("minServers set to " + val);
}
// check if we are the backup master - override the conf if so
if (cmd.hasOption("backup")) {
getConf().setBoolean(HConstants.MASTER_TYPE_BACKUP, true);
}
List<String> remainingArgs = cmd.getArgList();
if (remainingArgs.size() != 1) {
usage(null);
return -1;
}
String command = remainingArgs.get(0);
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;
}
}