hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aajis...@apache.org
Subject hadoop git commit: HDFS-11290. TestFSNameSystemMBean should wait until JMX cache is cleared. Contributed by Erik Krogen.
Date Wed, 18 Jan 2017 08:56:33 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 42a14b6db -> db47bd15d


HDFS-11290. TestFSNameSystemMBean should wait until JMX cache is cleared. Contributed by Erik
Krogen.

(cherry picked from commit b1a9ec856b572894e769f052aea2340fc3f23c78)


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

Branch: refs/heads/branch-2
Commit: db47bd15dd80a4a5727607832c16635cb0ec7726
Parents: 42a14b6
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Wed Jan 18 17:53:21 2017 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Wed Jan 18 17:56:22 2017 +0900

----------------------------------------------------------------------
 .../hdfs/server/namenode/TestFSNamesystemMBean.java       | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/db47bd15/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSNamesystemMBean.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSNamesystemMBean.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSNamesystemMBean.java
index e8db18f..b66bdbc 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSNamesystemMBean.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSNamesystemMBean.java
@@ -34,6 +34,8 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
+import org.apache.hadoop.metrics2.impl.ConfigBuilder;
+import org.apache.hadoop.metrics2.impl.TestMetricsConfig;
 import org.junit.Test;
 import org.mortbay.util.ajax.JSON;
 
@@ -139,12 +141,16 @@ public class TestFSNamesystemMBean {
     MiniDFSCluster cluster = null;
     FSNamesystem fsn = null;
 
+    int jmxCachePeriod = 1;
+    new ConfigBuilder().add("namenode.period", jmxCachePeriod)
+        .save(TestMetricsConfig.getTestFilename("hadoop-metrics2-namenode"));
     try {
       cluster = new MiniDFSCluster.Builder(conf).build();
       cluster.waitActive();
 
       fsn = cluster.getNameNode().namesystem;
       fsn.writeLock();
+      Thread.sleep(jmxCachePeriod * 1000);
 
       MBeanClient client = new MBeanClient();
       client.start();
@@ -167,11 +173,15 @@ public class TestFSNamesystemMBean {
   @Test
   public void testWithFSEditLogLock() throws Exception {
     Configuration conf = new Configuration();
+    int jmxCachePeriod = 1;
+    new ConfigBuilder().add("namenode.period", jmxCachePeriod)
+        .save(TestMetricsConfig.getTestFilename("hadoop-metrics2-namenode"));
     MiniDFSCluster cluster = null;
     try {
       cluster = new MiniDFSCluster.Builder(conf).build();
       cluster.waitActive();
       synchronized (cluster.getNameNode().getFSImage().getEditLog()) {
+        Thread.sleep(jmxCachePeriod * 1000);
         MBeanClient client = new MBeanClient();
         client.start();
         client.join(20000);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message