You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ay...@apache.org on 2020/11/03 04:48:12 UTC

[ozone] branch master updated: HDDS-4410. Cache DatanodeDetails#getUuidString(). (#1538). Contributed by Ayush Saxena.

This is an automated email from the ASF dual-hosted git repository.

ayushsaxena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 5d9af79  HDDS-4410. Cache DatanodeDetails#getUuidString(). (#1538). Contributed by Ayush Saxena.
5d9af79 is described below

commit 5d9af799b8901839d138c6ceeb6cad3bd0427254
Author: Ayush Saxena <ay...@apache.org>
AuthorDate: Tue Nov 3 10:17:59 2020 +0530

    HDDS-4410. Cache DatanodeDetails#getUuidString(). (#1538). Contributed by Ayush Saxena.
---
 .../main/java/org/apache/hadoop/hdds/protocol/DatanodeDetails.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeDetails.java b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeDetails.java
index 73a1389..1a42f3a 100644
--- a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeDetails.java
+++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeDetails.java
@@ -47,6 +47,7 @@ public class DatanodeDetails extends NodeImpl implements
    * DataNode's unique identifier in the cluster.
    */
   private final UUID uuid;
+  private final String uuidString;
 
   private String ipAddress;
   private String hostName;
@@ -77,6 +78,7 @@ public class DatanodeDetails extends NodeImpl implements
       String version, long setupTime, String revision, String buildDate) {
     super(hostName, networkLocation, NetConstants.NODE_COST_DEFAULT);
     this.uuid = uuid;
+    this.uuidString = uuid.toString();
     this.ipAddress = ipAddress;
     this.hostName = hostName;
     this.ports = ports;
@@ -91,6 +93,7 @@ public class DatanodeDetails extends NodeImpl implements
     super(datanodeDetails.getHostName(), datanodeDetails.getNetworkLocation(),
         datanodeDetails.getCost());
     this.uuid = datanodeDetails.uuid;
+    this.uuidString = uuid.toString();
     this.ipAddress = datanodeDetails.ipAddress;
     this.hostName = datanodeDetails.hostName;
     this.ports = datanodeDetails.ports;
@@ -117,7 +120,7 @@ public class DatanodeDetails extends NodeImpl implements
    * @return UUID of DataNode
    */
   public String getUuidString() {
-    return uuid.toString();
+    return uuidString;
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org