-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add service status as command option to admin command #4567
Conversation
// process resource groups | ||
var payload = r.getSecond(); | ||
String[] tokens = payload.split(","); | ||
String groupSeparator = ""; | ||
if (tokens.length == 2) { | ||
groupNames.add(tokens[1]); | ||
groupSeparator = tokens[1] + ": "; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this parsing the lock content represented by the ServerServices object? If so, be aware that this changed in 3.1, ref: https://github.com/apache/accumulo/blob/main/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java#L664
sb.append(I2).append("resource groups:\n"); | ||
summary.getResourceGroups().forEach(g -> sb.append(I4).append(g).append("\n")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to print the groups twice? I wonder if we could print something like:
Group: DEFAULT
localhost:1234
localhost:1235
Group: Group1
localhost:1236
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address in f5f9221
This addresses PR comment to avoid displaying resource groups multiple times. It also changes the json output to use group name and a set of hosts. This makes it easier to pull out resources by resource group. Also includes some code clean-up
The output changes in f5f9221 organize services by resource group. This slightly modifies the command and the json output. text output
json output (formatted with jq)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. On the merge upstream, note the following:
- The classs ServiceLockData can be used to parse the lock data in main
- The Coordinator was merged into the Manager in elasticity
- the merge of #4567 needs additional changes because of ServiceLock data in ZooKeeper. This will be done as a separate PR.
Adds a admin command
serviceStatus
to print service counts and hosts, with resource groups when appropriate to stdout.To run the command:
> accumulo admin serviceStatus [--noHosts ] [--json]
The noHost option output provides a summary count
The --json option provides unformatted json output (the --noHost option is ignored)
Sample output:
Summary (service counts only)
Full status
Full status formatted as json
Fixes #4495