diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 7050377cd85..6ec4b672473 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -2806,6 +2806,7 @@ public class HRegionServer extends HasThread implements LOG.debug("Exception details for failure to fetch wal coprocessor information.", exception); } } + coprocessors.addAll(rsHost.getCoprocessors()); return coprocessors.toArray(new String[coprocessors.size()]); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXListener.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXListener.java index af602a5b268..8bb58698bc0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXListener.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXListener.java @@ -29,8 +29,10 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.testclassification.MediumTests; +import org.apache.hadoop.hbase.util.JVMClusterUtil; import org.junit.AfterClass; import org.junit.Assert; +import static org.junit.Assert.fail; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; @@ -92,5 +94,20 @@ public class TestJMXListener { } + @Test + public void testGetRegionServerCoprocessors() throws Exception { + for (JVMClusterUtil.RegionServerThread rs : UTIL.getHBaseCluster().getRegionServerThreads()) { + boolean find = false; + for (String s : rs.getRegionServer().getRegionServerCoprocessors()) { + if (s.equals(JMXListener.class.getSimpleName())) { + find = true; + break; + } + } + if (!find) { + fail("where is the JMXListener?"); + } + } + } } \ No newline at end of file