You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by si...@apache.org on 2023/02/10 15:18:51 UTC

[ozone] branch master updated: HDDS-7634. Recon: Show Datanode UUID on Pipeline page (#4135)

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

siyao 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 7c2db17276 HDDS-7634. Recon: Show Datanode UUID on Pipeline page (#4135)
7c2db17276 is described below

commit 7c2db17276e62162cb8c9eb69b331a5fe2c1c13d
Author: smitajoshi12 <11...@users.noreply.github.com>
AuthorDate: Fri Feb 10 20:48:43 2023 +0530

    HDDS-7634. Recon: Show Datanode UUID on Pipeline page (#4135)
---
 .../hadoop/ozone/recon/api/PipelineEndpoint.java   |   5 +-
 .../ozone/recon/api/types/PipelineMetadata.java    |   9 +-
 .../webapps/recon/ozone-recon-web/api/db.json      | 210 ++++++++++++++++++++-
 .../src/views/pipelines/pipelines.less             |   9 +-
 .../src/views/pipelines/pipelines.tsx              |  10 +-
 5 files changed, 226 insertions(+), 17 deletions(-)

diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/PipelineEndpoint.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/PipelineEndpoint.java
index c5cc6d9cdf..2cc448b131 100644
--- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/PipelineEndpoint.java
+++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/PipelineEndpoint.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.ozone.recon.api;
 
+import org.apache.hadoop.hdds.protocol.DatanodeDetails;
 import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
 import org.apache.hadoop.hdds.scm.server.OzoneStorageContainerManager;
 import org.apache.hadoop.ozone.recon.MetricsServiceProviderFactory;
@@ -75,9 +76,9 @@ public class PipelineEndpoint {
 
     pipelines.forEach(pipeline -> {
       UUID pipelineId = pipeline.getId().getId();
-      List<String> datanodes = new ArrayList<>();
+      List<DatanodeDetails> datanodes = new ArrayList<>();
       PipelineMetadata.Builder builder = PipelineMetadata.newBuilder();
-      pipeline.getNodes().forEach(node -> datanodes.add(node.getHostName()));
+      pipeline.getNodes().forEach(node -> datanodes.add(node));
       long duration =
           Instant.now().toEpochMilli() -
               pipeline.getCreationTimestamp().toEpochMilli();
diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/PipelineMetadata.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/PipelineMetadata.java
index e7facbf1f1..d26f87f6f7 100644
--- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/PipelineMetadata.java
+++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/PipelineMetadata.java
@@ -20,6 +20,7 @@ package org.apache.hadoop.ozone.recon.api.types;
 import com.google.common.base.Preconditions;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.hadoop.hdds.client.ReplicationConfig;
+import org.apache.hadoop.hdds.protocol.DatanodeDetails;
 import org.apache.hadoop.hdds.scm.pipeline.Pipeline.PipelineState;
 
 import javax.xml.bind.annotation.XmlAccessType;
@@ -44,7 +45,7 @@ public final class PipelineMetadata {
   private String leaderNode;
 
   @XmlElement(name = "datanodes")
-  private List<String> datanodes;
+  private List<DatanodeDetails> datanodes;
 
   @XmlElement(name = "lastLeaderElection")
   private long lastLeaderElection;
@@ -78,7 +79,7 @@ public final class PipelineMetadata {
     return leaderNode;
   }
 
-  public List<String> getDatanodes() {
+  public List<DatanodeDetails> getDatanodes() {
     return datanodes;
   }
 
@@ -137,7 +138,7 @@ public final class PipelineMetadata {
     private UUID pipelineId;
     private PipelineState status;
     private String leaderNode;
-    private List<String> datanodes;
+    private List<DatanodeDetails> datanodes;
     private long lastLeaderElection;
     private long duration;
     private long leaderElections;
@@ -183,7 +184,7 @@ public final class PipelineMetadata {
       return this;
     }
 
-    public Builder setDatanodes(List<String> datanodes) {
+    public Builder setDatanodes(List<DatanodeDetails> datanodes) {
       this.datanodes = datanodes;
       return this;
     }
diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/db.json b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/db.json
index fcd4ed6a92..4749a0d6a0 100644
--- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/db.json
+++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/db.json
@@ -684,9 +684,57 @@
         "status": "OPEN",
         "leaderNode": "localhost1.storage.enterprise.com",
         "datanodes": [
-          "localhost1.storage.enterprise.com",
-          "localhost2.storage.enterprise.com",
-          "localhost3.storage.enterprise.com"
+          {
+          "level": 0,
+          "parent": null,
+          "cost": 0,
+          "uuid": "9e4e92da-4abd-461d-b042-dc4fe72e8727",
+          "uuidString": "9e4e92da-4abd-461d-b042-dc4fe72e8727",
+          "ipAddress": "172.22.0.5",
+          "hostName": "ozone_datanode_1.ozone_default",
+          "ports": [
+            {
+              "name": "REPLICATION",
+              "value": 9886
+            },
+            {
+              "name": "RATIS",
+              "value": 9858
+            },
+            {
+              "name": "RATIS_ADMIN",
+              "value": 9857
+            },
+            {
+              "name": "RATIS_SERVER",
+              "value": 9856
+            },
+            {
+              "name": "RATIS_DATASTREAM",
+              "value": 9855
+            },
+            {
+              "name": "STANDALONE",
+              "value": 9859
+            }
+          
+          ],
+          "certSerialId": null,
+          "version": null,
+          "setupTime": 0,
+          "revision": null,
+          "buildDate": null,
+          "persistedOpState": "IN_SERVICE",
+          "persistedOpStateExpiryEpochSec": 0,
+          "initialVersion": 0,
+          "currentVersion": 1,
+          "signature": -460136136,
+          "decomissioned": false,
+          "networkName": "9e4e92da-4abd-461d-b042-dc4fe72e8727",
+          "networkLocation": "/default-rack",
+          "networkFullPath": "/default-rack/9e4e92da-4abd-461d-b042-dc4fe72e8727",
+          "numOfLeaves": 1
+          }
         ],
         "lastLeaderElection": 1578491471528,
         "duration": 389445,
@@ -700,9 +748,106 @@
         "status": "OPEN",
         "leaderNode": "localhost5.storage.enterprise.com",
         "datanodes": [
-          "localhost4.storage.enterprise.com",
-          "localhost5.storage.enterprise.com",
-          "localhost6.storage.enterprise.com"
+          {
+            "level": 0,
+            "parent": null,
+            "cost": 0,
+            "uuid": "9e4e92da-4abd-461d-b042-dc4fe72e8728",
+            "uuidString": "9e4e92da-4abd-461d-b042-dc4fe72e8728",
+            "ipAddress": "172.22.0.5",
+            "hostName": "ozone_datanode_2.ozone_default",
+            "ports": [
+              {
+                "name": "REPLICATION",
+                "value": 9886
+              },
+              {
+                "name": "RATIS",
+                "value": 9858
+              },
+              {
+                "name": "RATIS_ADMIN",
+                "value": 9857
+              },
+              {
+                "name": "RATIS_SERVER",
+                "value": 9856
+              },
+              {
+                "name": "RATIS_DATASTREAM",
+                "value": 9855
+              },
+              {
+                "name": "STANDALONE",
+                "value": 9859
+              }
+            ],
+            "certSerialId": null,
+            "version": null,
+            "setupTime": 0,
+            "revision": null,
+            "buildDate": null,
+            "persistedOpState": "IN_SERVICE",
+            "persistedOpStateExpiryEpochSec": 0,
+            "initialVersion": 0,
+            "currentVersion": 1,
+            "signature": -460136136,
+            "decomissioned": false,
+            "networkName": "9e4e92da-4abd-461d-b042-dc4fe72e8727",
+            "networkLocation": "/default-rack",
+            "networkFullPath": "/default-rack/9e4e92da-4abd-461d-b042-dc4fe72e8727",
+            "numOfLeaves": 1
+          },
+          {
+            "level": 0,
+            "parent": null,
+            "cost": 0,
+            "uuid": "0523e1bb-d0a8-457c-be51-5e30ee0ad295",
+            "uuidString": "0523e1bb-d0a8-457c-be51-5e30ee0ad295",
+            "ipAddress": "172.22.0.3",
+            "hostName": "ozone_datanode_3.ozone_default",
+            "ports": [
+              {
+                "name": "REPLICATION",
+                "value": 9886
+              },
+              {
+                "name": "RATIS",
+                "value": 9858
+              },
+              {
+                "name": "RATIS_ADMIN",
+                "value": 9857
+              },
+              {
+                "name": "RATIS_SERVER",
+                "value": 9856
+              },
+              {
+                "name": "RATIS_DATASTREAM",
+                "value": 9855
+              },
+              {
+                "name": "STANDALONE",
+                "value": 9859
+              }
+            ],
+            "certSerialId": null,
+            "version": null,
+            "setupTime": 0,
+            "revision": null,
+            "buildDate": null,
+            "persistedOpState": "IN_SERVICE",
+            "persistedOpStateExpiryEpochSec": 0,
+            "initialVersion": 0,
+            "currentVersion": 1,
+            "signature": 776905284,
+            "decomissioned": false,
+            "networkName": "0523e1bb-d0a8-457c-be51-5e30ee0ad295",
+            "networkLocation": "/default-rack",
+            "networkFullPath": "/default-rack/0523e1bb-d0a8-457c-be51-5e30ee0ad295",
+            "numOfLeaves": 1
+          }
         ],
         "lastLeaderElection": 1578441471528,
         "duration": 50073382,
@@ -716,9 +861,56 @@
         "status": "CLOSED",
         "leaderNode": "localhost9.storage.enterprise.com",
         "datanodes": [
-          "localhost7.storage.enterprise.com",
-          "localhost8.storage.enterprise.com",
-          "localhost9.storage.enterprise.com"
+          {
+            "level": 0,
+            "parent": null,
+            "cost": 0,
+            "uuid": "e9011d34-2aeb-49fc-ab17-a35175342058",
+            "uuidString": "e9011d34-2aeb-49fc-ab17-a35175342058",
+            "ipAddress": "172.22.0.2",
+            "hostName": "ozone_datanode_4.ozone_default",
+            "ports": [
+              {
+                "name": "REPLICATION",
+                "value": 9886
+              },
+              {
+                "name": "RATIS",
+                "value": 9858
+              },
+              {
+                "name": "RATIS_ADMIN",
+                "value": 9857
+              },
+              {
+                "name": "RATIS_SERVER",
+                "value": 9856
+              },
+              {
+                "name": "RATIS_DATASTREAM",
+                "value": 9855
+              },
+              {
+                "name": "STANDALONE",
+                "value": 9859
+              }
+            ],
+            "certSerialId": null,
+            "version": null,
+            "setupTime": 0,
+            "revision": null,
+            "buildDate": null,
+            "persistedOpState": "IN_SERVICE",
+            "persistedOpStateExpiryEpochSec": 0,
+            "initialVersion": 0,
+            "currentVersion": 1,
+            "signature": 1287180809,
+            "decomissioned": false,
+            "networkName": "e9011d34-2aeb-49fc-ab17-a35175342058",
+            "networkLocation": "/default-rack",
+            "networkFullPath": "/default-rack/e9011d34-2aeb-49fc-ab17-a35175342058",
+            "numOfLeaves": 1
+          }
         ],
         "lastLeaderElection": 1578441871828,
         "duration": 49712212,
diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/pipelines/pipelines.less b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/pipelines/pipelines.less
index e02a66117c..97c76f22f9 100644
--- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/pipelines/pipelines.less
+++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/pipelines/pipelines.less
@@ -20,4 +20,11 @@
   .content-div {
     .ant-tabs-tab-active {cursor:none!important};
   }
-}
\ No newline at end of file
+}
+
+.uuidtooltip {
+  cursor: pointer;
+  .ant-tooltip-inner {
+    width: max-content;
+  }
+}
diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/pipelines/pipelines.tsx b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/pipelines/pipelines.tsx
index db1150e3d0..39dd84c6a6 100644
--- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/pipelines/pipelines.tsx
+++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/pipelines/pipelines.tsx
@@ -111,7 +111,15 @@ const COLUMNS = [
     dataIndex: 'datanodes',
     key: 'datanodes',
     isSearchable: true,
-    render: (datanodes: string[]) => <div>{datanodes.map(datanode => <div key={datanode}>{datanode}</div>)}</div>
+    render: (datanodes: string[]) => <div> {datanodes && datanodes.map(datanode =>
+      <div key={datanode.hostName}>
+        <div className='uuidtooltip'>
+          <Tooltip placement='top' title={`UUID: ${datanode && datanode.uuid}`} getPopupContainer={(triggerNode) => triggerNode}>
+            {datanode && datanode.hostName}
+          </Tooltip>
+        </div>
+      </div>)}
+    </div>
   },
   {
     title: 'Leader',


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