@Override
  public void start(CoprocessorEnvironment env) throws IOException {
    RegionCoprocessorEnvironment renv = (RegionCoprocessorEnvironment) env;
    try {
      this.cache = ((ZKDataHolder) renv.getSharedData().computeIfAbsent(ZKKEY, k -> {
        String ensemble = renv.getConfiguration().get(ZK_ENSEMBLE_KEY);
        int sessionTimeout =
          renv.getConfiguration().getInt(ZK_SESSION_TIMEOUT_KEY, ZK_SESSION_TIMEOUT_DEFAULT);
        return new ZKDataHolder(ensemble, sessionTimeout);
      })).acquire();
    } catch (Exception e) {
      throw new IOException(e);
    }
  }
Internal watcher that keep "data" up to date asynchronously.
hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ZooKeeperScanPolicyObserver.java