private static TimerTask getTimerTask(final long timeoutMs, final CompletableFuture<?> future,
    final String api) {
    return timeout -> {
      if (!future.isDone()) {
        future.completeExceptionally(new DoNotRetryIOException(
          "Zookeeper " + api + " could not be completed in " + timeoutMs + " ms"));
      }
    };
  }
A very simple read only zookeeper implementation without watcher support.
hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ReadOnlyZKClient.java