/** * Return the RegionServer-level and Region-level coprocessors * * @return string array of loaded RegionServer-level and Region-level coprocessors */ public String[] getRsCoprocessors() { // Need a set to remove duplicates, but since generated Coprocessor class // is not Comparable, make it a Set<String> instead of Set<Coprocessor> TreeSet<String> coprocessSet = new TreeSet<String>(); for (Coprocessor coprocessor : obtainServerLoadPB().getCoprocessorsList()) { coprocessSet.add(coprocessor.getName()); } return coprocessSet.toArray(new String[coprocessSet.size()]); }
/** * Return the RegionServer-level coprocessors * * @return string array of loaded RegionServer-level coprocessors */ public String[] getRegionServerCoprocessors() { List<Coprocessor> list = obtainServerLoadPB().getCoprocessorsList(); String[] ret = new String[list.size()]; int i = 0; for (Coprocessor elem : list) { ret[i++] = elem.getName(); } return ret; }