Merged r1239464 from trunk for HDFS-2814.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1239794 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jitendra Nath Pandey 2012-02-02 19:52:05 +00:00
parent 4c78384ecb
commit 1884fe4648
3 changed files with 7 additions and 1 deletions

View File

@ -98,6 +98,9 @@ Release 0.23.1 - UNRELEASED
HDFS-2397. Undeprecate SecondaryNameNode (eli)
HDFS-2814. NamenodeMXBean does not account for svn revision in the version
information. (Hitesh Shah via jitendra)
OPTIMIZATIONS
HDFS-2130. Switch default checksum to CRC32C. (todd)

View File

@ -4222,7 +4222,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());