/** * @return boolean */ @Override public boolean isHostUp(Host host) { HostConnectionPool<CL> pool = hosts.get(host); if (pool != null) { return !pool.isReconnecting(); } return false; }
/** * Refresh the partition */ public synchronized void refresh() { List<HostConnectionPool<CL>> pools = Lists.newArrayList(); for (HostConnectionPool<CL> pool : this.pools) { if (!pool.isReconnecting()) { pools.add(pool); } } this.activePools.set(strategy.sortAndfilterPartition(pools, prioritize)); }
/** * Refresh the partition */ public synchronized void refresh() { List<HostConnectionPool<CL>> pools = Lists.newArrayList(); for (HostConnectionPool<CL> pool : this.pools) { if (!pool.isReconnecting()) { pools.add(pool); } } this.activePools.set(strategy.sortAndfilterPartition(pools, prioritize)); }
/** * @return boolean */ @Override public boolean isHostUp(Host host) { HostConnectionPool<CL> pool = hosts.get(host); if (pool != null) { return !pool.isReconnecting(); } return false; }
while (iter.hasNext()) { HostConnectionPool<CL> pool = iter.next(); if (pool.isReconnecting()) {
while (iter.hasNext()) { HostConnectionPool<CL> pool = iter.next(); if (pool.isReconnecting()) {
protected boolean returnConnection(Connection<CL> connection) { if (connection != null) { if (connection.getHostConnectionPool().isReconnecting() || connection.getOperationCount() > config.getMaxOperationsPerConnection()) { closeConnection(connection); } else { ConnectionException ce = connection.getLastException(); if (ce != null && (ce instanceof IsDeadConnectionException || ce instanceof IsTimeoutException)) { closeConnection(connection); } else if (!this.idleConnections.offer(connection)) { closeConnection(connection); } else { this.monitor.incConnectionReturned(connection.getHostConnectionPool().getHost()); } } return true; } return false; }
protected boolean returnConnection(Connection<CL> connection) { if (connection != null) { if (connection.getHostConnectionPool().isReconnecting() || connection.getOperationCount() > config.getMaxOperationsPerConnection()) { closeConnection(connection); } else { ConnectionException ce = connection.getLastException(); if (ce != null && (ce instanceof IsDeadConnectionException || ce instanceof IsTimeoutException)) { closeConnection(connection); } else if (!this.idleConnections.offer(connection)) { closeConnection(connection); } else { this.monitor.incConnectionReturned(connection.getHostConnectionPool().getHost()); } } return true; } return false; }