if (opts.help || cl.getParsedCommand() == null) {
cl.usage();
return;
}
Instance instance = opts.getInstance();
try {
String principal;
AuthenticationToken token;
if (opts.getToken() == null) {
principal = SecurityConstants.getSystemPrincipal();
token = SecurityConstants.getSystemToken();
} else {
principal = opts.principal;
token = opts.getToken();
}
if (cl.getParsedCommand().equals("stop")) {
stopTabletServer(instance, CredentialHelper.create(principal, token, instance.getInstanceID()), stopOpts.args, opts.force);
} else {
everything = cl.getParsedCommand().equals("stopAll");
if (everything)
flushAll(instance, principal, token);
stopServer(instance, CredentialHelper.create(principal, token, instance.getInstanceID()), everything);
}
} catch (AccumuloException e) {
log.error(e,e);
System.exit(1);
} catch (AccumuloSecurityException e) {