java.lang.Object
org.elasticsearch.action.bulk.FailureStoreDocument
Transforms an indexing request using error information into a new index request to be stored in a data stream's failure store.
-
Method Summary
Modifier and TypeMethodDescriptionstatic IndexRequest
transformFailedRequest
(IndexRequest source, Exception exception, String targetIndexName) Combines anIndexRequest
that has failed during the bulk process with the error thrown for that request.static IndexRequest
transformFailedRequest
(IndexRequest source, Exception exception, String targetIndexName, Supplier<Long> timeSupplier) Combines anIndexRequest
that has failed during the bulk process with the error thrown for that request.
-
Method Details
-
transformFailedRequest
public static IndexRequest transformFailedRequest(IndexRequest source, Exception exception, String targetIndexName) throws IOException Combines anIndexRequest
that has failed during the bulk process with the error thrown for that request. The result is a newIndexRequest
that can be stored in a data stream's failure store.- Parameters:
source
- The original request that has failed to be ingestedexception
- The exception that was thrown that caused the request to fail to be ingestedtargetIndexName
- The index that the request was targeting at time of failure- Returns:
- A new
IndexRequest
with a failure store compliant structure - Throws:
IOException
- If there is a problem when the document's new source is serialized
-
transformFailedRequest
public static IndexRequest transformFailedRequest(IndexRequest source, Exception exception, String targetIndexName, Supplier<Long> timeSupplier) throws IOException Combines anIndexRequest
that has failed during the bulk process with the error thrown for that request. The result is a newIndexRequest
that can be stored in a data stream's failure store.- Parameters:
source
- The original request that has failed to be ingestedexception
- The exception that was thrown that caused the request to fail to be ingestedtargetIndexName
- The index that the request was targeting at time of failuretimeSupplier
- Supplies the value for the document's timestamp- Returns:
- A new
IndexRequest
with a failure store compliant structure - Throws:
IOException
- If there is a problem when the document's new source is serialized
-