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

This commit is contained in:
tedyu 2016-12-20 08:55:07 -08:00
parent 97d1ba4015
commit b9689808eb
2 changed files with 18 additions and 0 deletions

View File

@ -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()]);
}

View File

@ -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?");
}
}
}
}