private void handleUpdateFailureWithRetry(final ActionListener<UpdateResponse> listener, final UpdateRequest request, final Exception failure, int retryCount) { final Throwable cause = unwrapCause(failure); if (cause instanceof VersionConflictEngineException) { if (retryCount < request.retryOnConflict()) { logger.trace("Retry attempt [{}] of [{}] on version conflict on [{}][{}][{}]", retryCount + 1, request.retryOnConflict(), request.index(), request.getShardId(), request.id()); threadPool.executor(executor()).execute(new ActionRunnable<UpdateResponse>(listener) { @Override protected void doRun() { shardOperation(request, listener, retryCount + 1); } }); return; } } listener.onFailure(cause instanceof Exception ? (Exception) cause : new NotSerializableExceptionWrapper(cause)); } }
public NotSerializableExceptionWrapper(Throwable other) { super(ElasticsearchException.getExceptionName(other) + ": " + other.getMessage(), other.getCause()); this.name = ElasticsearchException.getExceptionName(other); this.status = ExceptionsHelper.status(other); setStackTrace(other.getStackTrace()); for (Throwable otherSuppressed : other.getSuppressed()) { addSuppressed(otherSuppressed); } if (other instanceof ElasticsearchException) { ElasticsearchException ex = (ElasticsearchException) other; for (String key : ex.getHeaderKeys()) { this.addHeader(key, ex.getHeader(key)); } for (String key : ex.getMetadataKeys()) { this.addMetadata(key, ex.getMetadata(key)); } } }
public NotSerializableExceptionWrapper(Throwable other) { super(ElasticsearchException.getExceptionName(other) + ": " + other.getMessage(), other.getCause()); this.name = ElasticsearchException.getExceptionName(other); this.status = ExceptionsHelper.status(other); setStackTrace(other.getStackTrace()); for (Throwable otherSuppressed : other.getSuppressed()) { addSuppressed(otherSuppressed); } if (other instanceof ElasticsearchException) { ElasticsearchException ex = (ElasticsearchException) other; for (String key : ex.getHeaderKeys()) { this.addHeader(key, ex.getHeader(key)); } } }
public NotSerializableExceptionWrapper(Throwable other) { super(ElasticsearchException.getExceptionName(other) + ": " + other.getMessage(), other.getCause()); this.name = ElasticsearchException.getExceptionName(other); this.status = ExceptionsHelper.status(other); setStackTrace(other.getStackTrace()); for (Throwable otherSuppressed : other.getSuppressed()) { addSuppressed(otherSuppressed); } if (other instanceof ElasticsearchException) { ElasticsearchException ex = (ElasticsearchException) other; for (String key : ex.getHeaderKeys()) { this.addHeader(key, ex.getHeader(key)); } for (String key : ex.getMetadataKeys()) { this.addMetadata(key, ex.getMetadata(key)); } } }
ex = (ElasticsearchException) throwable; } else { ex = new NotSerializableExceptionWrapper(throwable);
public NotSerializableExceptionWrapper(Throwable other) { super(ElasticsearchException.getExceptionName(other) + ": " + other.getMessage(), other.getCause()); this.name = ElasticsearchException.getExceptionName(other); this.status = ExceptionsHelper.status(other); setStackTrace(other.getStackTrace()); for (Throwable otherSuppressed : other.getSuppressed()) { addSuppressed(otherSuppressed); } if (other instanceof ElasticsearchException) { ElasticsearchException ex = (ElasticsearchException) other; for (String key : ex.getHeaderKeys()) { this.addHeader(key, ex.getHeader(key)); } for (String key : ex.getMetadataKeys()) { this.addMetadata(key, ex.getMetadata(key)); } } }
@Override public void onFailure(Exception e) { final Throwable cause = unwrapCause(e); if (cause instanceof VersionConflictEngineException) { if (retryCount < request.retryOnConflict()) { threadPool.executor(executor()).execute(new ActionRunnable<UpdateResponse>(listener) { @Override protected void doRun() { shardOperation(request, listener, retryCount + 1); } }); return; } } listener.onFailure(cause instanceof Exception ? (Exception) cause : new NotSerializableExceptionWrapper(cause)); } });
public NotSerializableExceptionWrapper(Throwable other) { super(ElasticsearchException.getExceptionName(other) + ": " + other.getMessage(), other.getCause()); this.name = ElasticsearchException.getExceptionName(other); this.status = ExceptionsHelper.status(other); setStackTrace(other.getStackTrace()); for (Throwable otherSuppressed : other.getSuppressed()) { addSuppressed(otherSuppressed); } if (other instanceof ElasticsearchException) { ElasticsearchException ex = (ElasticsearchException) other; for (String key : ex.getHeaderKeys()) { this.addHeader(key, ex.getHeader(key)); } for (String key : ex.getMetadataKeys()) { this.addMetadata(key, ex.getMetadata(key)); } } }
@Override public void onFailure(Exception e) { final Throwable cause = unwrapCause(e); if (cause instanceof VersionConflictEngineException) { if (retryCount < request.retryOnConflict()) { threadPool.executor(executor()).execute(new ActionRunnable<UpdateResponse>(listener) { @Override protected void doRun() { shardOperation(request, listener, retryCount + 1); } }); return; } } listener.onFailure(cause instanceof Exception ? (Exception) cause : new NotSerializableExceptionWrapper(cause)); } });
private void handleUpdateFailureWithRetry(final ActionListener<UpdateResponse> listener, final UpdateRequest request, final Exception failure, int retryCount) { final Throwable cause = unwrapCause(failure); if (cause instanceof VersionConflictEngineException) { if (retryCount < request.retryOnConflict()) { logger.trace("Retry attempt [{}] of [{}] on version conflict on [{}][{}][{}]", retryCount + 1, request.retryOnConflict(), request.index(), request.getShardId(), request.id()); threadPool.executor(executor()).execute(new ActionRunnable<UpdateResponse>(listener) { @Override protected void doRun() { shardOperation(request, listener, retryCount + 1); } }); return; } } listener.onFailure(cause instanceof Exception ? (Exception) cause : new NotSerializableExceptionWrapper(cause)); } }
private void handleUpdateFailureWithRetry(final ActionListener<UpdateResponse> listener, final UpdateRequest request, final Exception failure, int retryCount) { final Throwable cause = unwrapCause(failure); if (cause instanceof VersionConflictEngineException) { if (retryCount < request.retryOnConflict()) { logger.trace("Retry attempt [{}] of [{}] on version conflict on [{}][{}][{}]", retryCount + 1, request.retryOnConflict(), request.index(), request.getShardId(), request.id()); threadPool.executor(executor()).execute(new ActionRunnable<UpdateResponse>(listener) { @Override protected void doRun() { shardOperation(request, listener, retryCount + 1); } }); return; } } listener.onFailure(cause instanceof Exception ? (Exception) cause : new NotSerializableExceptionWrapper(cause)); } }
@Override public void onFailure(Exception e) { final Throwable cause = ExceptionsHelper.unwrapCause(e); if (cause instanceof VersionConflictEngineException) { if (retryCount < request.retryOnConflict()) { logger.trace("Retry attempt [{}] of [{}] on version conflict on [{}][{}][{}]", retryCount + 1, request.retryOnConflict(), request.index(), request.getShardId(), request.id()); threadPool.executor(executor()).execute(new ActionRunnable<UpdateResponse>(listener) { @Override protected void doRun() { shardOperation(request, listener, retryCount + 1); } }); return; } } listener.onFailure(cause instanceof Exception ? (Exception) cause : new NotSerializableExceptionWrapper(cause)); } });
ex = (ElasticsearchException) throwable; } else { ex = new NotSerializableExceptionWrapper(throwable);
ex = (ElasticsearchException) throwable; } else { ex = new NotSerializableExceptionWrapper(throwable);
ex = (ElasticsearchException) throwable; } else { ex = new NotSerializableExceptionWrapper(throwable);
ex = (ElasticsearchException) throwable; } else { ex = new NotSerializableExceptionWrapper(throwable);