Interface BulkListener<Context>

Type Parameters:
Context - application-defined contextual data that can be associated to a bulk operation.

public interface BulkListener<Context>
A listener that is called by a BulkIngester to allow monitoring requests sent and their result.
  • Method Details

    • beforeBulk

      void beforeBulk(long executionId, BulkRequest request, List<Context> contexts)
      Called before a bulk request is sent. Note: documents in request operations have been converted to BinaryData.
      Parameters:
      executionId - the id of this request, unique for the BulkIngester that created it.
      request - the bulk request that will be sent, with documents in binary form.
      contexts - application-defined data that was passed in BulkIngester.add(BulkOperation, Object).
    • afterBulk

      void afterBulk(long executionId, BulkRequest request, List<Context> contexts, BulkResponse response)
      Called after a bulk request has been processed. Elasticsearch accepted the request, but response the response may contain both successful and failure response items.
      Parameters:
      executionId - the id of this request, unique for the BulkIngester that created it.
      request - the bulk request that will be sent, with documents in binary form.
      contexts - application-defined data that was passed in BulkIngester.add(BulkOperation, Object).
      response - the response received from Elasticsearch.
    • afterBulk

      void afterBulk(long executionId, BulkRequest request, List<Context> contexts, Throwable failure)
      Called when a bulk request could not be sent to Elasticsearch.
      Parameters:
      executionId - the id of this request, unique for the BulkIngester that created it.
      request - the bulk request that will be sent, with documents in binary form.
      contexts - application-defined data that was passed in BulkIngester.add(BulkOperation, Object).
      failure - the failure that occurred when sending the request to Elasticsearch.