Class FailureStoreDocument

java.lang.Object
org.elasticsearch.action.bulk.FailureStoreDocument

public final class FailureStoreDocument extends Object
Transforms an indexing request using error information into a new index request to be stored in a data stream's failure store.
  • Method Details

    • transformFailedRequest

      public static IndexRequest transformFailedRequest(IndexRequest source, Exception exception, String targetIndexName) throws IOException
      Combines an IndexRequest that has failed during the bulk process with the error thrown for that request. The result is a new IndexRequest that can be stored in a data stream's failure store.
      Parameters:
      source - The original request that has failed to be ingested
      exception - The exception that was thrown that caused the request to fail to be ingested
      targetIndexName - 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 an IndexRequest that has failed during the bulk process with the error thrown for that request. The result is a new IndexRequest that can be stored in a data stream's failure store.
      Parameters:
      source - The original request that has failed to be ingested
      exception - The exception that was thrown that caused the request to fail to be ingested
      targetIndexName - The index that the request was targeting at time of failure
      timeSupplier - 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