This is an automated email from the ASF dual-hosted git repository.
adoroszlai 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 58c3166094 HDDS-6767. Add network location in Recon's datanode page
(#3429)
58c3166094 is described below
commit 58c3166094cc27f65da49f5edd5a12ff1103a96e
Author: Symious <[email protected]>
AuthorDate: Mon Jul 25 00:49:39 2022 +0800
HDDS-6767. Add network location in Recon's datanode page (#3429)
---
.../apache/hadoop/ozone/recon/api/NodeEndpoint.java | 1 +
.../ozone/recon/api/types/DatanodeMetadata.java | 14 ++++++++++++++
.../src/views/datanodes/datanodes.tsx | 20 ++++++++++++++++----
3 files changed, 31 insertions(+), 4 deletions(-)
diff --git
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java
index d4b126fcc3..33df0ca1bd 100644
---
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java
+++
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java
@@ -148,6 +148,7 @@ public class NodeEndpoint {
.withBuildDate(nodeManager.getBuildDate(datanode))
.withLayoutVersion(
dnInfo.getLastKnownLayoutVersion().getMetadataLayoutVersion())
+ .withNetworkLocation(datanode.getNetworkLocation())
.build());
});
diff --git
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/DatanodeMetadata.java
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/DatanodeMetadata.java
index 12778a5166..4927c4a1e8 100644
---
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/DatanodeMetadata.java
+++
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/DatanodeMetadata.java
@@ -77,6 +77,9 @@ public final class DatanodeMetadata {
@XmlElement(name = "layoutVersion")
private int layoutVersion;
+ @XmlElement(name = "networkLocation")
+ private String networkLocation;
+
private DatanodeMetadata(Builder builder) {
this.hostname = builder.hostname;
this.uuid = builder.uuid;
@@ -93,6 +96,7 @@ public final class DatanodeMetadata {
this.revision = builder.revision;
this.buildDate = builder.buildDate;
this.layoutVersion = builder.layoutVersion;
+ this.networkLocation = builder.networkLocation;
}
public String getHostname() {
@@ -150,10 +154,15 @@ public final class DatanodeMetadata {
public String getBuildDate() {
return buildDate;
}
+
public int getLayoutVersion() {
return layoutVersion;
}
+ public String getNetworkLocation() {
+ return networkLocation;
+ }
+
/**
* Returns new builder class that builds a DatanodeMetadata.
*
@@ -183,6 +192,7 @@ public final class DatanodeMetadata {
private String revision;
private String buildDate;
private int layoutVersion;
+ private String networkLocation;
public Builder() {
this.containers = 0;
@@ -266,6 +276,10 @@ public final class DatanodeMetadata {
return this;
}
+ public Builder withNetworkLocation(String networkLocation) {
+ this.networkLocation = networkLocation;
+ return this;
+ }
/**
* Constructs DatanodeMetadata.
*
diff --git
a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx
b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx
index 1781002cb5..382ebdbfe6 100644
---
a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx
+++
b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx
@@ -53,6 +53,7 @@ interface IDatanodeResponse {
setupTime: number;
revision: string;
buildDate: string;
+ networkLocation: string;
}
interface IDatanodesResponse {
@@ -77,6 +78,7 @@ interface IDatanode {
setupTime: number;
revision: string;
buildDate: string;
+ networkLocation: string;
}
interface IPipeline {
@@ -214,7 +216,7 @@ const COLUMNS = [
<Icon type='info-circle'/>
</Tooltip>
</span>,
- dataIndex: 'leaderCount',
+ dataIndex: 'leader Count',
key: 'leaderCount',
isVisible: true,
isSearchable: true,
@@ -246,7 +248,7 @@ const COLUMNS = [
defaultSortOrder: 'ascend' as const
},
{
- title: 'SetupTime',
+ title: 'Setup Time',
dataIndex: 'setupTime',
key: 'setupTime',
isVisible: true,
@@ -265,13 +267,22 @@ const COLUMNS = [
defaultSortOrder: 'ascend' as const
},
{
- title: 'BuildDate',
+ title: 'Build Date',
dataIndex: 'buildDate',
key: 'buildDate',
isVisible: true,
isSearchable: true,
sorter: (a: IDatanode, b: IDatanode) =>
a.buildDate.localeCompare(b.buildDate),
defaultSortOrder: 'ascend' as const
+ },
+ {
+ title: 'Network Location',
+ dataIndex: 'networkLocation',
+ key: 'networkLocation',
+ isVisible: true,
+ isSearchable: true,
+ sorter: (a: IDatanode, b: IDatanode) =>
a.networkLocation.localeCompare(b.networkLocation),
+ defaultSortOrder: 'ascend' as const
}
];
@@ -342,7 +353,8 @@ export class Datanodes extends
React.Component<Record<string, object>, IDatanode
version: datanode.version,
setupTime: datanode.setupTime,
revision: datanode.revision,
- buildDate: datanode.buildDate
+ buildDate: datanode.buildDate,
+ networkLocation: datanode.networkLocation
};
});
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]