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:
parent
70bc14f234
commit
c909aedbc1
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue