@Override
  public void start(CoprocessorEnvironment env) throws IOException {
    if (env instanceof RegionCoprocessorEnvironment) {
      this.env = (RegionCoprocessorEnvironment) env;
      return;
    }
    throw new CoprocessorException("Must be loaded on a table region!");
  }
Test coprocessor endpoint that always throws a {@link DoNotRetryIOException} for requests on the
last region in the table. This allows tests to ensure correct error handling of coprocessor
endpoints throwing exceptions.
hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/ColumnAggregationEndpointWithErrors.java