Module org.elasticsearch.server
Package org.elasticsearch.action.bulk
Class FailureStoreDocumentConverter
java.lang.Object
org.elasticsearch.action.bulk.FailureStoreDocumentConverter
Transforms an indexing request using error information into a new index request to be stored in a data stream's failure store.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontransformFailedRequest
(IndexRequest source, Exception exception, String targetIndexName) Combines anIndexRequest
that has failed during the bulk process with the error thrown for that request.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.
-
Constructor Details
-
FailureStoreDocumentConverter
public FailureStoreDocumentConverter()
-
-
Method Details
-
transformFailedRequest
public 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 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
-