Example #1
0
    private boolean shutdown(long timeout, TimeUnit unit) throws InterruptedException {

      if (!isShutdown.compareAndSet(false, true)) return true;

      long start = System.nanoTime();
      boolean success = true;
      for (HostConnectionPool pool : pools.values())
        success &= pool.shutdown(timeout - Cluster.timeSince(start, unit), unit);
      return success;
    }
Example #2
0
    private void shutdown() {

      if (!isShutdown.compareAndSet(false, true)) return;

      for (HostConnectionPool pool : pools.values()) pool.shutdown();
    }