You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Tejaskriya (via GitHub)" <gi...@apache.org> on 2024/01/03 07:05:09 UTC
Re: [PR] HDDS-9648. Create API to fetch single datanode related information [ozone]
Tejaskriya commented on code in PR #5856:
URL: https://github.com/apache/ozone/pull/5856#discussion_r1440131434
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java:
##########
@@ -612,6 +612,29 @@ public List<HddsProtos.Node> queryNode(
return result;
}
+ @Override
+ public HddsProtos.Node querySingleNode(String uuid)
+ throws IOException {
+ HddsProtos.Node result = null;
+ for (DatanodeDetails node : scm.getScmNodeManager().getAllNodes()) {
+ try {
+ if (node.getUuid().toString().equals(uuid)) {
+ NodeStatus ns = scm.getScmNodeManager().getNodeStatus(node);
+ result = HddsProtos.Node.newBuilder()
+ .setNodeID(node.getProtoBufMessage())
+ .addNodeStates(ns.getHealth())
+ .addNodeOperationalStates(ns.getOperationalState())
+ .build();
+ break;
+ }
+ } catch (NodeNotFoundException e) {
+ throw new IOException(
+ "An unexpected error occurred querying the NodeStatus", e);
Review Comment:
I have used the same message used in queryNode() method earlier. I'm not sure what you are suggesting..
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org