/** Allows package private classes to update volatile ZooKeeper. */ void updateKeeper(SolrZooKeeper keeper) throws InterruptedException { SolrZooKeeper oldKeeper = this.keeper; this.keeper = keeper; if (oldKeeper != null) { oldKeeper.close(); } // we might have been closed already if (isClosed) this.keeper.close(); }
private void closeKeeper(SolrZooKeeper keeper) { if (keeper != null) { try { keeper.close(); } catch (InterruptedException e) { // Restore the interrupted status Thread.currentThread().interrupt(); log.error("", e); throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", e); } } }