keith-turner commented on code in PR #5745:
URL: https://github.com/apache/accumulo/pull/5745#discussion_r2220495732
##########
server/base/src/main/java/org/apache/accumulo/server/util/Admin.java:
##########
@@ -563,18 +554,89 @@ private static void stopServer(final ClientContext
context, final boolean tablet
client -> client.shutdown(TraceUtil.traceInfo(), context.rpcCreds(),
tabletServersToo));
}
- // Visible for tests
- public static void signalGracefulShutdown(final ClientContext context,
String address) {
+ private static void stopServers(final ServerContext context, List<String>
servers,
+ final boolean force)
+ throws AccumuloException, AccumuloSecurityException,
InterruptedException, KeeperException {
+ List<String> hostOnly = new ArrayList<>();
+ Set<HostAndPort> hostAndPort = new TreeSet<>();
- Objects.requireNonNull(address, "address not set");
- final HostAndPort hp = HostAndPort.fromString(address);
+ for (var server : servers) {
+ if (server.contains(":")) {
+ hostAndPort.add(HostAndPort.fromString(server));
+ } else {
+ hostOnly.add(server);
+ }
+ }
+
+ if (!hostOnly.isEmpty()) {
+ // TODO need to see how easy it is to use serverStatus to support
current functionality of
+ // specifying a host. Like what does the whole command to stop all
tservers on a host look
+ // like using admin serviceStatus and admin stop.
+ // TODO start deprecation warning in 4.0 instead of 2.1.x?
Review Comment:
I pulled the TODO and warnings out for 2.1. We definitely need to do
something in 4.0. The way the current code uses the tserver port config is a
sharp edge, it may not actually stop everything on the host. I tried starting
three tservers and then ran stop w/ just the host and it only stopped one based
on my port config. I did not have a port range, but I did have port search
enabled. I will open a follow on issue for 4.0 to change the behavior for
host only.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]