-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Parse JSON-style reports in golang side #18159
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…, and if need yaml, can still use --format yaml
Xenorith
reviewed
Sep 15, 2023
Xenorith
approved these changes
Sep 18, 2023
Xenorith
added
the
type-ease-of-use
This issue is about of how to improve the ease of use of Alluxio product
label
Sep 18, 2023
alluxio-bot, merge this please |
twalluxio
added a commit
to twalluxio/alluxio
that referenced
this pull request
Sep 18, 2023
Update the Golang side commands to be able to use this output: 1. Return either the yaml or json (default) output to the console. 2. Users can define the format they want with `--format` flag, like `bin/alluxio info report --format yaml` 3. In JSON format, print properties in a fixed, easy-to-read order 4. In YAML format, print properties alphabetically (since YAML specification regards property order non-significant) Before: ``` {"safeMode":false,"masterVersions":[{"version":"304-SNAPSHOT","host":"localhost","port":19998,"state":"PRIMARY"}],"masterAddress":"localhost:19998","zookeeperAddress":[],"useZookeeper":false,"raftJournalAddress":["localhost:19200"],"useRaftJournal":true,"liveWorkers":1,"lostWorkers":0,"freeCapacity":"1024.00MB","totalCapacityOnTiers":{"MEM":"1024.00MB"},"usedCapacityOnTiers":{"MEM":"0B"},"version":"304-SNAPSHOT","webPort":19999,"started":"09-15-2023 15:54:56:635","uptime":"0 day(s), 0 hour(s), 26 minute(s), and 37 second(s)","rpcPort":19998} ``` After (in JSON): ``` { "rpcPort": 19998, "started": "09-15-2023 15:54:56:635", "uptime": "0 day(s), 0 hour(s), 55 minute(s), and 31 second(s)", "safeMode": false, "version": "304-SNAPSHOT", "webPort": 19999, "masterVersions": [ { "version": "304-SNAPSHOT", "host": "localhost", "port": 19998, "state": "PRIMARY" } ], "masterAddress": "localhost:19998", "zookeeperAddress": [], "useZookeeper": false, "raftJournalAddress": [ "localhost:19200" ], "useRaftJournal": true, "liveWorkers": 1, "lostWorkers": 0, "freeCapacity": "1024.00MB", "totalCapacityOnTiers": { "MEM": "1024.00MB" }, "usedCapacityOnTiers": { "MEM": "0B" } } ``` After (in YAML): ``` freeCapacity: 1024.00MB liveWorkers: 1 lostWorkers: 0 masterAddress: localhost:19998 masterVersions: - host: localhost port: 19998 state: PRIMARY version: 304-SNAPSHOT raftJournalAddress: - localhost:19200 rpcPort: 19998 safeMode: false started: 09-15-2023 15:54:56:635 totalCapacityOnTiers: MEM: 1024.00MB uptime: 0 day(s), 1 hour(s), 1 minute(s), and 36 second(s) useRaftJournal: true useZookeeper: false usedCapacityOnTiers: MEM: 0B version: 304-SNAPSHOT webPort: 19999 zookeeperAddress: [] ``` pr-link: Alluxio#18159 change-id: cid-deb6e74552de9afcf45391c6c230a9fe00785e37 (cherry picked from commit 86308c3)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update the Golang side commands to be able to use this output:
--format
flag, likebin/alluxio info report --format yaml
Before:
After (in JSON):
After (in YAML):