@Override
  public RegionEnvironment createEnvironment(RegionCoprocessor instance, int priority, int seq,
    Configuration conf) {
    // If coprocessor exposes any services, register them.
    for (Service service : instance.getServices()) {
      region.registerService(service);
    }
    ConcurrentMap<String, Object> classData;
    // make sure only one thread can add maps
    synchronized (SHARED_DATA_MAP) {
      // as long as at least one RegionEnvironment holds on to its classData it will
      // remain in this map
      classData = SHARED_DATA_MAP.computeIfAbsent(instance.getClass().getName(),
        k -> new ConcurrentHashMap<>());
    }
    // If a CoreCoprocessor, return a 'richer' environment, one laden with RegionServerServices.
    return instance.getClass().isAnnotationPresent(CoreCoprocessor.class)
      ? new RegionEnvironmentForCoreCoprocessors(instance, priority, seq, conf, region, rsServices,
        classData)
      : new RegionEnvironment(instance, priority, seq, conf, region, rsServices, classData);
  }
Sanity check the table coprocessor attributes of the supplied schema. Will throw an exception
if there is a problem.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java