@Override void fail(SocketAddress address, Throwable t) { // StreamOp.fail is called to fail the overall request. In case of BulkWriteOp we take the request level // exception to apply to the first write. In fact for request level exceptions no request has ever been // attempted, but logically we associate the error with the first write. super.fail(address, t); Iterator<Promise<DLSN>> resultIterator = results.iterator(); // Fail the first write with the batch level failure. if (resultIterator.hasNext()) { Promise<DLSN> result = resultIterator.next(); result.setException(t); } // Fail the remaining writes as cancelled requests. while (resultIterator.hasNext()) { Promise<DLSN> result = resultIterator.next(); result.setException(new CancelledRequestException()); } }
@Override synchronized public void run(Timeout timeout) throws Exception { if (!timeout.isCancelled() && null != nextAddressToSend) { doSend(nextAddressToSend); } else { fail(null, new CancelledRequestException()); } } }
@Override void fail(SocketAddress address, Throwable t) { // StreamOp.fail is called to fail the overall request. In case of BulkWriteOp we take the request level // exception to apply to the first write. In fact for request level exceptions no request has ever been // attempted, but logically we associate the error with the first write. super.fail(address, t); Iterator<Promise<DLSN>> resultIterator = results.iterator(); // Fail the first write with the batch level failure. if (resultIterator.hasNext()) { Promise<DLSN> result = resultIterator.next(); result.setException(t); } // Fail the remaining writes as cancelled requests. while (resultIterator.hasNext()) { Promise<DLSN> result = resultIterator.next(); result.setException(new CancelledRequestException()); } }
@Override void fail(SocketAddress address, Throwable t) { // StreamOp.fail is called to fail the overall request. In case of BulkWriteOp we take the request level // exception to apply to the first write. In fact for request level exceptions no request has ever been // attempted, but logically we associate the error with the first write. super.fail(address, t); Iterator<Promise<DLSN>> resultIterator = results.iterator(); // Fail the first write with the batch level failure. if (resultIterator.hasNext()) { Promise<DLSN> result = resultIterator.next(); result.setException(t); } // Fail the remaining writes as cancelled requests. while (resultIterator.hasNext()) { Promise<DLSN> result = resultIterator.next(); result.setException(new CancelledRequestException()); } }
@Override public synchronized void run(Timeout timeout) throws Exception { if (!timeout.isCancelled() && null != nextAddressToSend) { doSend(nextAddressToSend); } else { fail(null, new CancelledRequestException()); } } }
@Override synchronized public void run(Timeout timeout) throws Exception { if (!timeout.isCancelled() && null != nextAddressToSend) { doSend(nextAddressToSend); } else { fail(null, new CancelledRequestException()); } } }