You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2023/06/14 20:49:22 UTC
[GitHub] [ozone] adoroszlai commented on a diff in pull request #4896: HDDS-8826. Avoid String to UUID conversion in SCMNodeManager
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: 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