adoroszlai commented on code in PR #4896:
URL: https://github.com/apache/ozone/pull/4896#discussion_r1230153318
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -1348,14 +1348,16 @@ public List<SCMCommand> getCommandQueue(UUID dnID) {
*/
@Override
public DatanodeDetails getNodeByUuid(String uuid) {
- if (Strings.isNullOrEmpty(uuid)) {
- LOG.warn("uuid is null");
- return null;
- }
- DatanodeDetails temp = DatanodeDetails.newBuilder()
- .setUuid(UUID.fromString(uuid)).build();
+ return uuid != null && !uuid.isEmpty()
+ ? getNodeByUuid(UUID.fromString(uuid))
+ : null;
+ }
+
+ @Override
+ public DatanodeDetails getNodeByUuid(UUID uuid) {
try {
- return nodeStateManager.getNode(temp);
+ return nodeStateManager.getNode(
+ DatanodeDetails.newBuilder().setUuid(uuid).build());
Review Comment:
You are right, we should do that. Thanks.
--
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]