HBASE-5258 Move coprocessors set out of RegionLoad - Addendum (Sergey)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1420521 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2012-12-12 04:39:06 +00:00
parent 0aec9dd711
commit 2c4a2a6c51
1 changed files with 8 additions and 4 deletions

View File

@ -43,6 +43,7 @@ import java.util.Random;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentSkipListMap;
@ -2253,10 +2254,13 @@ public class HRegionServer implements ClientProtocol,
// used by org/apache/hbase/tmpl/regionserver/RSStatusTmpl.jamon (HBASE-4070).
public String[] getCoprocessors() {
// passing fake times to buildServerLoad is okay, because we only care about the coprocessor part.
HBaseProtos.ServerLoad sl = buildServerLoad(0, 0);
return sl == null? null:
new ServerLoad(sl).getRegionServerCoprocessors();
TreeSet<String> coprocessors = new TreeSet<String>(
this.hlog.getCoprocessorHost().getCoprocessors());
Collection<HRegion> regions = getOnlineRegionsLocalContext();
for (HRegion region: regions) {
coprocessors.addAll(region.getCoprocessorHost().getCoprocessors());
}
return coprocessors.toArray(new String[0]);
}
/**