ArafatKhan2198 commented on PR #4054:
URL: https://github.com/apache/ozone/pull/4054#issuecomment-1361280863
Hi, @xBis7. Thanks for the review! As far as I know, the only way to display
the metrics in the format that you had suggested was to use a nested map. I
tried my best to see if we could display the information without using one. But
I could not find any. The only other way to display such information with
little complexity is to represent it as a string. Like I had done earlier.
```
{
"key" : "446dbffe-45d9-4c3d-b7f5-d8ad562a7dcb",
"value" : [ "{ HostName : ozone_datanode_2.ozone_default | Role :
Leader }" ]
}
```
The reason I chose it to be represented as a string earlier, is because we
have done something similar for OM-HA https://github.com/apache/ozone/pull/3520
and SCM-HA https://github.com/apache/ozone/pull/2260, where we displayed the
various roles of OM and SCM as strings, which was pretty simple for the user to
understand and get information out of it.
```
{
"RatisRoles": " { HostName: om1 | Node-Id: om1 | Ratis-Port : 9872 |
Role: FOLLOWER} { HostName: om2 | Node-Id: om2 | Ratis-Port : 9872 | Role:
LEADER} { HostName: om3 | Node-Id: om3 | Ratis-Port : 9872 | Role: FOLLOWER} "
}
```
```
{
ScmRatisRoles": "{ HostName : scm1, Ratis Port : 9894, Role : LEADER }
{ HostName : scm3, Ratis Port : 9894, Role : FOLLOWER } { HostName : scm2,
Ratis Port : 9894, Role : FOLLOWER } "
}
```
But since we wanted to get the information in key-value pairs, I could not
see any other options other than using a nested map.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]