Interface BatchListener<P>

  • Type Parameters:
    P - type of the record's payload
    All Known Implementing Classes:
    CompositeBatchListener

    public interface BatchListener<P>
    Allow implementing classes to get notified before/after processing each batch. Exception handling is done by the implementing class.
    Author:
    Mahmoud Ben Hassine ([email protected])
    • Method Detail

      • beforeBatchReading

        default void beforeBatchReading()
        Executed before reading each batch.
      • afterBatchProcessing

        default void afterBatchProcessing​(Batch<P> batch)
        Executed after processing each batch.
        Parameters:
        batch - the batch of records that has been processed
      • afterBatchWriting

        default void afterBatchWriting​(Batch<P> batch)
        Executed after successfully writing each batch.
        Parameters:
        batch - the batch of records that has been written
      • onBatchWritingException

        default void onBatchWritingException​(Batch<P> batch,
                                             java.lang.Throwable throwable)
        Executed when an error occurs during writing each batch.
        Parameters:
        batch - the batch attempted to be written
        throwable - the error occurred