Add list-all capability to accumulo-service - #6508
Conversation
Currently the accumulo-service script only supports listing information for individual services. There are times when a user will want to retrieve the PIDs for all processes managed by Accumulo. Modify the accumulo-service script to: - Add the service `all` that can be combined with the list command to list all processes. - Add the sub-options `-p`, `--parseable` to make the list command print only the name, pid, and port of each process for consistently formatted output. - Forbid the use of the service `all` with the start, stop, or kill command. Closes apache#6507
|
Seems like a good change. We have had conversations about making script / command output more CLI friendly, which is what you are trying to achieve here. I think we settled on JSON (@ctubbsii correct me here) so that the output could be parsed with |
|
I like the idea. Do you want me to switch out |
I think that would be good. I looked at the code earlier with this in mind and I don't think it's a heavy lift. |
Add the flag --json for the accumulo-service list command. When specified, the caller will receive output formatted as json.
|
Done. Updated the top comment with new examples reflecting the |
The json in the comment is invalid. One option is to add a leading I used |
|
Ah yes, you're right, silly of me. Fixing that now. |
|
Fixed to output valid json. Top comment examples are updated. |
|
I think your IDE messed with the spacing or something. |
|
Fixed. |
Currently the accumulo-service script only supports listing information for individual services. There are times when a user will want to retrieve the PIDs for all processes managed by Accumulo.
Modify the accumulo-service script to:
allthat can be combined with the list command to list all processes.--jsonto make the list command print only the name, pid, and port of each process as json. The output will always be a json array.allwith the start, stop, or kill command.Closes #6507
Some examples on a running Accumulo instance:
Default output:
Using the
--jsonoption combined withall:Using the
--jsonoption always results in a json array, even when there's just a single element:$ ./accumulo-service gc list --json [ { "process": "gc_default_1", "pid": "2001397", "port": "9998" } ]Using all is forbidden with any command other than list: