public interface IndexerListener
BulkIndexer computation asynchronously.
Note: It's important that the callback is not slow or heavyweight, as the BulkIndexer is
prevented from running during its execution, even if those listeners are to run in other
executors.| Modifier and Type | Method and Description |
|---|---|
void |
closed(BulkIndexerStats stats)
Finished
|
void |
onFailure(BulkOperation op,
BulkResponse.BulkOperationResponse response)
Invoked when a
BulkOperation fails individually. |
void |
onFailure(BulkOperation op,
BulkResponse result)
Invoked when a
BulkOperation fails because the entire request to the Elastic Bulk API
failed, always returning an HTTP status code outside the 2xx range. |
void |
onFailure(BulkOperation op,
java.lang.Throwable t)
Invoked when a
BulkOperation fails because the entire request failed, usually due to
an IOException. |
void |
onSuccess(BulkOperation op)
Invoked when a
BulkOperation is successful. |
void closed(BulkIndexerStats stats)
stats - indexer statsvoid onFailure(BulkOperation op, BulkResponse.BulkOperationResponse response)
BulkOperation fails individually. These operations always have a
status code outside the 2xx range, and they are generally not retryable because they have
status codes below the 5xx range, which are reserved for server-side issues.op - bulk operationresponse - bulk operation responsevoid onFailure(BulkOperation op, BulkResponse result)
BulkOperation fails because the entire request to the Elastic Bulk API
failed, always returning an HTTP status code outside the 2xx range.
Note: The bulk API request would been retried according to configured
BulkIndexerConfig.getRetryer() policy.op - bulk operation that failedresult - the response from the Elastic Bulk API, always with status code outside the 2xx
range.void onFailure(BulkOperation op, java.lang.Throwable t)
BulkOperation fails because the entire request failed, usually due to
an IOException. It's possible that the Elastic Bulk API never received the request.
Note: The bulk API request would been retried according to configured
BulkIndexerConfig.getRetryer() policy.op - bulk operation that failedt - the exception that caused failure, usually an IOExceptionvoid onSuccess(BulkOperation op)
BulkOperation is successful. These operations usually have a status
code in the 2xx range, but there are exceptions, such as 404 status code for delete
operations which are benign and merely reported that the requested record was not found.op - bulk operation