hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wan...@apache.org
Subject [03/42] hadoop git commit: HDFS-8981. Adding revision to data node jmx getVersion() method. (Siqi Li via mingma)
Date Fri, 11 Sep 2015 17:20:24 GMT
HDFS-8981. Adding revision to data node jmx getVersion() method. (Siqi Li via mingma)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/30db1ada
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/30db1ada
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/30db1ada

Branch: refs/heads/YARN-1197
Commit: 30db1adac31b07b34ce8e8d426cc139fb8cfad02
Parents: 715b9c6
Author: Ming Ma <mingma@apache.org>
Authored: Fri Sep 4 11:55:58 2015 -0700
Committer: Ming Ma <mingma@apache.org>
Committed: Fri Sep 4 11:55:58 2015 -0700

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt          |  3 +++
 .../apache/hadoop/hdfs/server/datanode/DataNode.java | 15 ++++++++++++---
 .../hadoop/hdfs/server/datanode/DataNodeMXBean.java  |  9 ++++++++-
 .../hdfs/server/datanode/TestDataNodeMXBean.java     |  6 ++++++
 4 files changed, 29 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/30db1ada/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 5226d33..de44324 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -36,6 +36,9 @@ Trunk (Unreleased)
 
     HDFS-8895. Remove deprecated BlockStorageLocation APIs. (wang)
 
+    HDFS-8981. Adding revision to data node jmx getVersion() method. (Siqi Li
+    via mingma)
+
   NEW FEATURES
 
     HDFS-3125. Add JournalService to enable Journal Daemon. (suresh)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/30db1ada/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
index e0adc6d..f72455d 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
@@ -2900,11 +2900,16 @@ public class DataNode extends ReconfigurableBase
     return NetUtils.createSocketAddr(
         conf.getTrimmed(DFS_DATANODE_ADDRESS_KEY, DFS_DATANODE_ADDRESS_DEFAULT));
   }
-  
+
   @Override // DataNodeMXBean
-  public String getVersion() {
+  public String getSoftwareVersion() {
     return VersionInfo.getVersion();
   }
+
+  @Override // DataNodeMXBean
+  public String getVersion() {
+    return VersionInfo.getVersion() + ", r" + VersionInfo.getRevision();
+  }
   
   @Override // DataNodeMXBean
   public String getRpcPort(){
@@ -2917,7 +2922,11 @@ public class DataNode extends ReconfigurableBase
   public String getHttpPort(){
     return this.getConf().get("dfs.datanode.info.port");
   }
-  
+
+  public String getRevision() {
+    return VersionInfo.getRevision();
+  }
+
   /**
    * @return the datanode's http port
    */

http://git-wip-us.apache.org/repos/asf/hadoop/blob/30db1ada/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNodeMXBean.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNodeMXBean.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNodeMXBean.java
index 92abd88..0119dc8 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNodeMXBean.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNodeMXBean.java
@@ -36,7 +36,14 @@ public interface DataNodeMXBean {
    * @return the version of Hadoop
    */
   public String getVersion();
-  
+
+  /**
+   * Get the version of software running on the DataNode
+   *
+   * @return a string representing the version
+   */
+  public String getSoftwareVersion();
+
   /**
    * Gets the rpc port.
    * 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/30db1ada/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMXBean.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMXBean.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMXBean.java
index b461e3a..a7d0a5e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMXBean.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMXBean.java
@@ -51,6 +51,12 @@ public class TestDataNodeMXBean {
       // get attribute "Version"
       String version = (String)mbs.getAttribute(mxbeanName, "Version");
       Assert.assertEquals(datanode.getVersion(),version);
+      // get attribute "SotfwareVersion"
+      String softwareVersion =
+          (String)mbs.getAttribute(mxbeanName, "SoftwareVersion");
+      Assert.assertEquals(datanode.getSoftwareVersion(),softwareVersion);
+      Assert.assertEquals(version, softwareVersion
+          + ", r" + datanode.getRevision());
       // get attribute "RpcPort"
       String rpcPort = (String)mbs.getAttribute(mxbeanName, "RpcPort");
       Assert.assertEquals(datanode.getRpcPort(),rpcPort);


Mime
View raw message