private void informException(ConnectionException connectionException) throws ConnectionException { connectionException .setHost(getCurrentHost()) .setLatency(System.currentTimeMillis() - startTime) .setAttempt(this.attemptCounter) .setLatencyWithPool(System.currentTimeMillis() - poolStartTime); if (connectionException instanceof IsRetryableException) { if (!canRetry()) { throw connectionException; } } else { // Most likely an operation error throw connectionException; } } }
.setLatency(System.currentTimeMillis() - startTime); throw new InterruptedOperationException("Thread interrupted waiting for connection") .setHost(getHost()) .setLatency(System.currentTimeMillis() - startTime);
.setLatency(System.currentTimeMillis() - startTime); throw new InterruptedOperationException("Thread interrupted waiting for connection") .setHost(getHost()) .setLatency(System.currentTimeMillis() - startTime);
private void informException(ConnectionException connectionException) throws ConnectionException { connectionException .setHost(getCurrentHost()) .setLatency(System.currentTimeMillis() - startTime) .setAttempt(this.attemptCounter) .setLatencyWithPool(System.currentTimeMillis() - poolStartTime); if (connectionException instanceof IsRetryableException) { if (!canRetry()) { throw connectionException; } } else { // Most likely an operation error throw connectionException; } } }
throw new PoolTimeoutException("Fast fail waiting for connection from pool") .setHost(getHost()) .setLatency(System.currentTimeMillis() - startTime);
throw new PoolTimeoutException("Fast fail waiting for connection from pool") .setHost(getHost()) .setLatency(System.currentTimeMillis() - startTime);
else connectionException = (ConnectionException)e; connectionException.setLatency(latency);
else connectionException = (ConnectionException)e; connectionException.setLatency(latency);
long now = System.nanoTime(); latency = now - startTime; lastException = ThriftConverter.ToConnectionPoolException(e).setLatency(latency); if (e instanceof IsTimeoutException) { pool.addLatencySample(TimeUnit.NANOSECONDS.convert(cpConfig.getSocketTimeout(), TimeUnit.MILLISECONDS), now); long now = System.nanoTime(); latency = now - startTime; lastException = ThriftConverter.ToConnectionPoolException(e).setLatency(latency); if (e instanceof IsTimeoutException) { pool.addLatencySample(TimeUnit.NANOSECONDS.convert(cpConfig.getSocketTimeout(), TimeUnit.MILLISECONDS), now);
long now = System.nanoTime(); latency = now - startTime; lastException = ThriftConverter.ToConnectionPoolException(e).setLatency(latency); if (e instanceof IsTimeoutException) { pool.addLatencySample(TimeUnit.NANOSECONDS.convert(cpConfig.getSocketTimeout(), TimeUnit.MILLISECONDS), now); long now = System.nanoTime(); latency = now - startTime; lastException = ThriftConverter.ToConnectionPoolException(e).setLatency(latency); if (e instanceof IsTimeoutException) { pool.addLatencySample(TimeUnit.NANOSECONDS.convert(cpConfig.getSocketTimeout(), TimeUnit.MILLISECONDS), now);
closeClient(); ConnectionException ce = ThriftConverter.ToConnectionPoolException(e).setHost(getHost()) .setLatency(System.currentTimeMillis() - startTime); monitor.incConnectionCreateFailed(getHost(), ce); throw ce; closeClient(); ConnectionException ce = ThriftConverter.ToConnectionPoolException(new RuntimeException("Error openning connection", t)).setHost(getHost()) .setLatency(System.currentTimeMillis() - startTime); monitor.incConnectionCreateFailed(getHost(), ce); throw ce;
closeClient(); ConnectionException ce = ThriftConverter.ToConnectionPoolException(e).setHost(getHost()) .setLatency(System.currentTimeMillis() - startTime); monitor.incConnectionCreateFailed(getHost(), ce); throw ce; closeClient(); ConnectionException ce = ThriftConverter.ToConnectionPoolException(new RuntimeException("Error openning connection", t)).setHost(getHost()) .setLatency(System.currentTimeMillis() - startTime); monitor.incConnectionCreateFailed(getHost(), ce); throw ce;