Class BulkProcessor


  • public class BulkProcessor
    extends java.lang.Object
    A bulk processor wrapper that makes flush() a synchronous operation.
    See Also:
    BulkProcessor
    • Constructor Summary

      Constructors 
      Constructor Description
      BulkProcessor​(java.util.function.Supplier<org.elasticsearch.action.bulk.BulkProcessor> internalProcessorSupplier)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(org.elasticsearch.action.delete.DeleteRequest request)  
      void add​(org.elasticsearch.action.index.IndexRequest request)  
      boolean awaitClose​(long timeout, java.util.concurrent.TimeUnit unit)  
      void flush()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BulkProcessor

        public BulkProcessor​(java.util.function.Supplier<org.elasticsearch.action.bulk.BulkProcessor> internalProcessorSupplier)
        Creates a new instance.
        Parameters:
        internalProcessor - The org.elasticsearch.action.bulk.BulkProcessor supplier. This supplier must return a new BulkProcessor instance each time Supplier.get() is called.
        Since:
        14.0.0
    • Method Detail

      • awaitClose

        public boolean awaitClose​(long timeout,
                                  java.util.concurrent.TimeUnit unit)
                           throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
        Since:
        14.0.0
        See Also:
        BulkProcessor.awaitClose(long, java.util.concurrent.TimeUnit)
      • add

        public void add​(org.elasticsearch.action.index.IndexRequest request)
        Since:
        14.0.0
        See Also:
        BulkProcessor.add(org.elasticsearch.action.index.IndexRequest)
      • add

        public void add​(org.elasticsearch.action.delete.DeleteRequest request)
        Since:
        14.0.0
        See Also:
        BulkProcessor.add(org.elasticsearch.action.delete.DeleteRequest)
      • flush

        public void flush()
        Throws:
        java.lang.IllegalStateException - if the internal bulk processor couldn't be closed in 5 minutes
        java.lang.RuntimeException - if the thread is interrupted while waiting
        Since:
        14.0.0
        See Also:
        BulkProcessor.flush()