String[] kv = confOpt.split("=", 2);
if (kv.length == 2) {
conf.set(kv[0], kv[1]);
LOG.debug("-D configuration override: " + kv[0] + "=" + kv[1]);
} else {
throw new ParseException("-D option format invalid: " + confOpt);
}
}
}
if (cmd.getArgList().contains("start")) {
try {
// If 'local', don't start a region server here. Defer to
// LocalHBaseCluster. It manages 'local' clusters.
if (LocalHBaseCluster.isLocal(conf)) {
LOG.warn("Not starting a distinct region server because " +
HConstants.CLUSTER_DISTRIBUTED + " is false");
} else {
RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
if (runtime != null) {
LOG.info("vmInputArguments=" + runtime.getInputArguments());
}
HRegionServer hrs = constructRegionServer(regionServerClass, conf);
startRegionServer(hrs);
}
} catch (Throwable t) {
LOG.error( "Can not start region server because "+
StringUtils.stringifyException(t) );
System.exit(-1);
}
} else if (cmd.getArgList().contains("stop")) {
throw new ParseException("To shutdown the regionserver run " +
"bin/hbase-daemon.sh stop regionserver or send a kill signal to" +
"the regionserver pid");
} else {
throw new ParseException("Unknown argument(s): " +
org.apache.commons.lang.StringUtils.join(cmd.getArgs(), " "));
}
} catch (ParseException e) {
LOG.error("Could not parse", e);
printUsageAndExit();