public static Map<String, CoprocessorInfo> getCoprocessorInfo(HTableDescriptor tableDescriptor) {
    Map<String, CoprocessorInfo> info = Maps.newHashMap();

    // Extract information about existing data janitor coprocessor
    // The following logic is copied from RegionCoprocessorHost in HBase
    for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> entry: tableDescriptor.getValues().entrySet()) {
      String key = Bytes.toString(entry.getKey().get()).trim();
      String spec = Bytes.toString(entry.getValue().get()).trim();

      if (!HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(key).matches()) {
        continue;
      }

      try {
        Matcher matcher = HConstants.CP_HTD_ATTR_VALUE_PATTERN.matcher(spec);
        if (!matcher.matches()) {
          continue;
        }

        String className = matcher.group(2).trim();
        Path path = matcher.group(1).trim().isEmpty() ? null : new Path(matcher.group(1).trim());
        int priority = matcher.group(3).trim().isEmpty() ? Coprocessor.PRIORITY_USER
          : Integer.valueOf(matcher.group(3));
        String cfgSpec = null;
        try {
          cfgSpec = matcher.group(4);
        } catch (IndexOutOfBoundsException ex) {
          // ignore
        }

        Map<String, String> properties = Maps.newHashMap();
        if (cfgSpec != null) {
          cfgSpec = cfgSpec.substring(cfgSpec.indexOf('|') + 1);
          // do an explicit deep copy of the passed configuration
          Matcher m = HConstants.CP_HTD_ATTR_VALUE_PARAM_PATTERN.matcher(cfgSpec);
          while (m.find()) {
            properties.put(m.group(1), m.group(2));
          }
        }
        info.put(className, new CoprocessorInfo(className, path, priority, properties));
      } catch (Exception ex) {
        LOG.warn("Coprocessor attribute '{}' has invalid coprocessor specification '{}'", key, spec, ex);
      }
    }

    return info;
  }
public static Map < String , CoprocessorInfo > getCoprocessorInfo ( HTableDescriptor tableDescriptor ) { Map < String , CoprocessorInfo > info = Maps . newHashMap ( ) ; for ( Map . Entry < ImmutableBytesWritable , ImmutableBytesWritable > entry : tableDescriptor . getValues ( ) . entrySet ( ) ) { String key = Bytes . toString ( entry . getKey ( ) . get ( ) ) . trim ( ) ; String spec = Bytes . toString ( entry . getValue ( ) . get ( ) ) . trim ( ) ; if ( ! HConstants . CP_HTD_ATTR_KEY_PATTERN . matcher ( key ) . matches ( ) ) { continue ; } try { Matcher matcher = HConstants . CP_HTD_ATTR_VALUE_PATTERN . matcher ( spec ) ; if ( ! matcher . matches ( ) ) { continue ; } String className = matcher . group ( 2 ) . trim ( ) ; Path path = matcher . group ( 1 ) . trim ( ) . isEmpty ( ) ? null : new Path ( matcher . group ( 1 ) . trim ( ) ) ; int priority = matcher . group ( 3 ) . trim ( ) . isEmpty ( ) ? Coprocessor . PRIORITY_USER : Integer . valueOf ( matcher . group ( 3 ) ) ; String cfgSpec = null ; try { cfgSpec = matcher . group ( 4 ) ; } catch ( IndexOutOfBoundsException ex ) { } Map < String , String > properties = Maps . newHashMap ( ) ; if ( cfgSpec != null ) { cfgSpec = cfgSpec . substring ( cfgSpec . indexOf ( '|' ) + 1 ) ; Matcher m = HConstants . CP_HTD_ATTR_VALUE_PARAM_PATTERN . matcher ( cfgSpec ) ; while ( m . find ( ) ) { properties . put ( m . group ( 1 ) , m . group ( 2 ) ) ; } } info . put ( className , new CoprocessorInfo ( className , path , priority , properties ) ) ; } catch ( Exception ex ) { LOG . warn ( "Coprocessor attribute '{}' has invalid coprocessor specification '{}'" , key , spec , ex ) ; } } return info ; }
Returns information for all coprocessor configured for the table.

@return a Map from coprocessor class name to CoprocessorInfo