Package com.netflix.astyanax.connectionpool.exceptions

Examples of com.netflix.astyanax.connectionpool.exceptions.TimeoutException


                    Assert.assertEquals(0,     pool.getIdleConnectionCount());
                   
                    connection.execute(new TestOperation() {
                        @Override
                        public String execute(TestClient client, ConnectionContext context) throws ConnectionException {
                            throw new TimeoutException("Test");
                        }
                    });
                   
                    Assert.fail();
                }
                catch (Throwable t) {
                }
                finally {
                    pool.returnConnection(connection);
                }
                Assert.assertEquals(i+1,     pool.getErrorsSinceLastSuccess());
                Assert.assertEquals(0,     pool.getActiveConnectionCount());
                Assert.assertEquals(false, pool.isReconnecting());
                Assert.assertEquals(0,     pool.getIdleConnectionCount());
            }
           
            Connection<TestClient> connection = pool.borrowConnection(WAIT_TIMEOUT);
            try {
                Assert.assertEquals(1,     pool.getActiveConnectionCount());
                Assert.assertEquals(false, pool.isReconnecting());
                Assert.assertEquals(0,     pool.getIdleConnectionCount());
               
                connection.execute(new TestOperation() {
                    @Override
                    public String execute(TestClient client, ConnectionContext context) throws ConnectionException {
                        throw new TimeoutException("Test");
                    }
                });
            }
            catch (Throwable t) {
            }
View Full Code Here


        }
        else if (e instanceof UnavailableException) {
            return new TokenRangeOfflineException(e);
        }
        else if (e instanceof SocketTimeoutException) {
            return new TimeoutException(e);
        }
        else if (e instanceof TimedOutException) {
            return new OperationTimeoutException(e);
        }
        else if (e instanceof NotFoundException) {
            return new com.netflix.astyanax.connectionpool.exceptions.NotFoundException(e);
        }
        else if (e instanceof TApplicationException) {
            return new ThriftStateException(e);
        }
        else if (e instanceof AuthenticationException || e instanceof AuthorizationException) {
            return new com.netflix.astyanax.connectionpool.exceptions.AuthenticationException(e);
        }
        else if (e instanceof SchemaDisagreementException) {
            return new com.netflix.astyanax.connectionpool.exceptions.SchemaDisagreementException(e);
        }
        else if (e instanceof TTransportException) {
            if (e.getCause() != null) {
                if (e.getCause() instanceof SocketTimeoutException) {
                    return new TimeoutException(e);
                }
                if (e.getCause().getMessage() != null) {
                    if (e.getCause().getMessage().toLowerCase().contains("connection abort")
                            || e.getCause().getMessage().toLowerCase().contains("connection reset")) {
                        return new ConnectionAbortedException(e);
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.connectionpool.exceptions.TimeoutException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.