@Override
    public void prePut(final ObserverContext<? extends RegionCoprocessorEnvironment> e,
      final Put put, final WALEdit edit, final Durability durability) throws IOException {
      try (Table table = e.getEnvironment().getConnection().getTable(otherTable, getPool())) {
        Put p = new Put(new byte[] { 'a' });
        p.addColumn(family, null, new byte[] { 'a' });
        try {
          table.batch(Collections.singletonList(put), null);
        } catch (InterruptedException e1) {
          throw new IOException(e1);
        }
        completedWithPool[0] = true;
      }
    }
@return a pool that has one thread only at every time. A second action added to the pool (
        running concurrently), will cause an exception.
hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java