HDFS-2814 NamenodeMXBean does not account for svn revision in the version information. Contributed by Hitesh Shah.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1239464 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jitendra Nath Pandey 2012-02-02 05:31:46 +00:00
parent 70bc14f234
commit c909aedbc1
3 changed files with 7 additions and 1 deletions

View File

@ -107,6 +107,9 @@ Trunk (unreleased changes)
HDFS-2801. Provide a method in client side translators to check for a
methods supported in underlying protocol. (jitendra)
HDFS-2814 NamenodeMXBean does not account for svn revision in the version
information. (Hitesh Shah via jitendra)
OPTIMIZATIONS
HDFS-2477. Optimize computing the diff between a block report and the
namenode state. (Tomasz Nykiel via hairong)

View File

@ -4322,7 +4322,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
*/
@Override // NameNodeMXBean
public String getVersion() {
return VersionInfo.getVersion();
return VersionInfo.getVersion() + ", r" + VersionInfo.getRevision();
}
@Override // NameNodeMXBean

View File

@ -25,6 +25,7 @@ import javax.management.ObjectName;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.hadoop.hdfs.server.namenode.FSNamesystem;
import org.apache.hadoop.util.VersionInfo;
import org.junit.Test;
import junit.framework.Assert;
@ -57,6 +58,8 @@ public class TestNameNodeMXBean {
// get attribute "Version"
String version = (String) mbs.getAttribute(mxbeanName, "Version");
Assert.assertEquals(fsn.getVersion(), version);
Assert.assertTrue(version.equals(VersionInfo.getVersion()
+ ", r" + VersionInfo.getRevision()));
// get attribute "Used"
Long used = (Long) mbs.getAttribute(mxbeanName, "Used");
Assert.assertEquals(fsn.getUsed(), used.longValue());