Interface ErrorHandler<I extends Exceptional,O,C extends ErrorCollector<O>>

All Known Implementing Classes:
AbortOnFailure, DropAndLog, ElasticsearchHandler

public interface ErrorHandler<I extends Exceptional,O,C extends ErrorCollector<O>>
Handler interface to be notified of and handle recoverable errors during connector execution.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called at the close of the connector to clean up any internal resources.
    void
    init(Properties properties)
    Called at the handler creation time to initialize any internal state or resources.
    onError(I entry, C collector)
    Called when an exception or failure occurs in a part of the connector.
  • Method Details

    • init

      void init(Properties properties)
      Called at the handler creation time to initialize any internal state or resources.
      Parameters:
      properties - Properties for this handler with handler name prefix stripped away.
    • onError

      HandlerResult onError(I entry, C collector) throws Exception
      Called when an exception or failure occurs in a part of the connector.
      Parameters:
      entry - information about the failure, normally includes operational data and error information
      collector - handler for accepting user reactions to the failure, like retrying with modified parameters
      Returns:
      An enum that describes the handler's result, either that it handled the error or if the error should be passed on to the next handler.
      Throws:
      Exception - In the event that the current failure should not be handled, and should halt the connector processing.
    • close

      void close()
      Called at the close of the connector to clean up any internal resources.