public void close() { if (isClosed) return; // it's okay if we over close - same as solrcore isClosed = true; try { closeKeeper(keeper); } finally { connManager.close(); closeCallbackExecutor(); } assert ObjectReleaseTracker.release(this); }
connected(); connectionStrategy.connected(); } else if (state == Expired) { SolrException.log(log, "", e); log.info("Could not connect due to error, sleeping for 5s and trying agian"); waitSleep(1000); } else if (state == KeeperState.Disconnected) { log.warn("zkClient has disconnected"); disconnected(); connectionStrategy.disconnected(); } else if (state == KeeperState.AuthFailed) {
@Override public void update(SolrZooKeeper keeper) { try { waitForConnected(Long.MAX_VALUE); } catch (Exception e1) { closeKeeper(keeper); throw new RuntimeException(e1); } log.info("Connection with ZooKeeper reestablished."); try { client.updateKeeper(keeper); } catch (InterruptedException e) { closeKeeper(keeper); Thread.currentThread().interrupt(); // we must have been asked to stop throw new RuntimeException(e); } catch (Exception t) { closeKeeper(keeper); throw new RuntimeException(t); } if (onReconnect != null) { onReconnect.command(); } } });
connManager = new ConnectionManager("ZooKeeperConnection Watcher:" + zkServerAddress, this, zkServerAddress, strat, onReconnect, beforeReconnect); connManager.close(); if (keeper != null) { try { connManager.waitForConnected(clientConnectTimeout); } catch (Exception e) { connManager.close(); try { keeper.close();
connected(); connectionStrategy.connected(); } else if (state == KeeperState.Expired) { } else if (state == KeeperState.Disconnected) { log.info("zkClient has disconnected"); disconnected(); connectionStrategy.disconnected(); } else if (state == KeeperState.AuthFailed) {
headers.add("zkConnected", zkController != null ? !zkController.getZkClient().getConnectionManager().isLikelyExpired() : false);
connManager = new ConnectionManager("ZooKeeperConnection Watcher:" + zkServerAddress, this, zkServerAddress, strat, onReconnect, beforeReconnect); connManager.close(); if (keeper != null) { try { connManager.waitForConnected(clientConnectTimeout); } catch (Exception e) { connManager.close(); try { keeper.close();
public void close() { if (isClosed) return; // it's okay if we over close - same as solrcore isClosed = true; try { closeKeeper(keeper); } finally { connManager.close(); closeCallbackExecutor(); } assert ObjectReleaseTracker.release(this); }
@Override public void update(SolrZooKeeper keeper) { try { waitForConnected(Long.MAX_VALUE); } catch (Exception e1) { closeKeeper(keeper); throw new RuntimeException(e1); } log.info("Connection with ZooKeeper reestablished."); try { client.updateKeeper(keeper); } catch (InterruptedException e) { closeKeeper(keeper); Thread.currentThread().interrupt(); // we must have been asked to stop throw new RuntimeException(e); } catch (Exception t) { closeKeeper(keeper); throw new RuntimeException(t); } if (onReconnect != null) { onReconnect.command(); } } });