Skip to content

HDDS-6641. datanode usageinfo CLI should provide JSON output option#3356

Merged
adoroszlai merged 2 commits intoapache:masterfrom
sodonnel:HDDS-6641
Apr 29, 2022
Merged

HDDS-6641. datanode usageinfo CLI should provide JSON output option#3356
adoroszlai merged 2 commits intoapache:masterfrom
sodonnel:HDDS-6641

Conversation

@sodonnel
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add the option for the command ozone admin datanode usageinfo to output as JSON/

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-6641

How was this patch tested?

New unit tests. Also verified the JSON out using a docker-compose cluster:

bash-4.2$ ozone admin datanode usageinfo -m --json
[ {
  "datanodeDetails" : {
    "level" : 0,
    "cost" : 0,
    "uuid" : "cf92907e-ed4d-49e5-9e4e-0283f8815e80",
    "uuidString" : "cf92907e-ed4d-49e5-9e4e-0283f8815e80",
    "ipAddress" : "172.23.0.7",
    "hostName" : "ozone_datanode_1.ozone_default",
    "ports" : [ {
      "name" : "REPLICATION",
      "value" : 9886
    }, {
      "name" : "RATIS",
      "value" : 9858
    }, {
      "name" : "RATIS_ADMIN",
      "value" : 9857
    }, {
      "name" : "RATIS_SERVER",
      "value" : 9856
    }, {
      "name" : "STANDALONE",
      "value" : 9859
    } ],
    "setupTime" : 0,
    "persistedOpState" : "IN_SERVICE",
    "persistedOpStateExpiryEpochSec" : 0,
    "initialVersion" : 0,
    "currentVersion" : 1,
    "signature" : 20570720,
    "networkName" : "cf92907e-ed4d-49e5-9e4e-0283f8815e80",
    "networkLocation" : "/default-rack",
    "networkFullPath" : "/default-rack/cf92907e-ed4d-49e5-9e4e-0283f8815e80",
    "numOfLeaves" : 1
  },
  "capacity" : 62725623808,
  "remaining" : 41445900288,
  "totalUsed" : 21279723520,
  "ozoneUsed" : 8192,
  "totalUsedPercent" : 33.93,
  "ozoneUsedPercent" : 0.00,
  "remainingPercent" : 66.07
}, {
 ...

Copy link
Copy Markdown
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sodonnel for the improvement. LGTM, with one minor suggestion for the test.

Copy link
Copy Markdown
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sodonnel for updating the patch.

@adoroszlai adoroszlai merged commit 81b6bba into apache:master Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants