@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { throw new TransportException("TransportException"); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { throw new TransportException("TransportException"); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { throw new TransportException("TransportException"); }
@Override public void open(long timeout) throws ConnectionException { if (++retry == 2) { // success } else { throw new TransportException("TransportException"); } } },
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { throw new TransportException("TransportException"); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { throw new TransportException("TransportException"); }
@Override public void open(long timeout) throws ConnectionException { throw new TransportException("TransportException"); } },
@Override public void open(long timeout) throws ConnectionException { if (count.incrementAndGet() <= 2) { throw new TransportException("connection refused"); } } },
@Override public void open(long timeout) throws ConnectionException { if (count.getAndIncrement() == 0) { throw new TransportException("connection refused"); } } },
@Override public void open(long timeout) throws ConnectionException { if (count.incrementAndGet() <= 2) { throw new TransportException("connection refused"); } } },
@Override public void open(long timeout) throws ConnectionException { if (count.getAndIncrement() == 0) { throw new TransportException("connection refused"); } } },
@Override public void open(long timeout) throws ConnectionException { throw new TransportException(CONNECT_TRANSPORT_ERROR.name()); } },
@Override public void open(long timeout) throws ConnectionException { throw new TransportException(CONNECT_TRANSPORT_ERROR.name()); } },
@Override public void open(long timeout) throws ConnectionException { double p = new Random().nextDouble(); if (p < 0.002) { throw new HostDownException("HostDownException"); } else if (p < 0.004) { throw new TimeoutException("HostDownException"); } else if (p < 0.006) { throw new TransportException("TransportException"); } think(200); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { if (counter.incrementAndGet() > new Random().nextInt(1000)) { counter.set(0); throw new TransportException("TransportException"); } return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public void open(long timeout) throws ConnectionException { double p = new Random().nextDouble(); if (p < 0.002) { throw new HostDownException("HostDownException"); } else if (p < 0.004) { throw new TimeoutException("HostDownException"); } else if (p < 0.006) { throw new TransportException("TransportException"); } think(200); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { if (counter.incrementAndGet() > new Random().nextInt(1000)) { counter.set(0); throw new TransportException("TransportException"); } return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { think(100); if (counter.incrementAndGet() > 10) { counter.set(0); throw new TransportException("TransportException"); } return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { if (counter.incrementAndGet() > 100) { counter.set(0); throw new TransportException("TransportException"); } return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { think(100); if (counter.incrementAndGet() > 10) { counter.set(0); throw new TransportException("TransportException"); } return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }