HBASE-17344 The regionserver web UIs miss the coprocessors of RegionServerCoprocessorHost (ChiaPing Tsai)

This commit is contained in:
tedyu 2016-12-20 08:52:45 -08:00
parent a2e967d92f
commit e75dee3a21
2 changed files with 18 additions and 1 deletions

View File

@ -2928,6 +2928,7 @@ public class HRegionServer extends HasThread implements
LOG.debug("Exception details for failure to fetch wal coprocessor information.", exception); LOG.debug("Exception details for failure to fetch wal coprocessor information.", exception);
} }
} }
coprocessors.addAll(rsHost.getCoprocessors());
return coprocessors.toArray(new String[coprocessors.size()]); return coprocessors.toArray(new String[coprocessors.size()]);
} }

View File

@ -30,8 +30,10 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.testclassification.MiscTests;
import org.apache.hadoop.hbase.util.JVMClusterUtil;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Assert; import org.junit.Assert;
import static org.junit.Assert.fail;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
@ -93,5 +95,19 @@ 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?");
}
}
}
} }