@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { think(2000); throw new TimeoutException("SocketTimeException"); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { think(2000); throw new TimeoutException("SocketTimeException"); }
@Override public void open(long timeout) throws ConnectionException { try { Thread.sleep(50); } catch (InterruptedException e) { } throw new TimeoutException("TimeoutException"); } },
@Override public void open(long timeout) throws ConnectionException { if (count.get() >= failAfter) { think(1000); throw new TimeoutException("Timeout"); // count.set(0); } } },
@Override public void open(long timeout) throws ConnectionException { try { Thread.sleep(50); } catch (InterruptedException e) { } throw new TimeoutException("TimeoutException"); } },
@Override public void open(long timeout) throws ConnectionException { if (count.get() >= failAfter) { think(1000); throw new TimeoutException("Timeout"); // count.set(0); } } },
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { think(50 + new Random().nextInt(1000)); throw new TimeoutException("thrashing_timeout"); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { think(50 + new Random().nextInt(1000)); throw new TimeoutException("thrashing_timeout"); }
@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 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 (count.incrementAndGet() >= failAfter) { throw new TimeoutException("TimeoutException"); } return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), think(5)); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { if (count.incrementAndGet() >= failAfter) { throw new TimeoutException("TimeoutException"); } return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), think(5)); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { if (counter.incrementAndGet() / 200 % 2 == 1) { think(200); throw new TimeoutException("SocketTimeException"); } else { return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), think(0)); } }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { if (counter.incrementAndGet() / 200 % 2 == 1) { think(200); throw new TimeoutException("SocketTimeException"); } else { return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), think(0)); } }
return new TimeoutException(e); if (e.getCause() != null) { if (e.getCause() instanceof SocketTimeoutException) { return new TimeoutException(e);
return new TimeoutException(e); if (e.getCause() != null) { if (e.getCause() instanceof SocketTimeoutException) { return new TimeoutException(e);