Package org.elasticsearch.hadoop.handler
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 TypeMethodDescriptionvoidclose()Called at the close of the connector to clean up any internal resources.voidinit(Properties properties) Called at the handler creation time to initialize any internal state or resources.Called when an exception or failure occurs in a part of the connector.
-
Method Details
-
init
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
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 informationcollector- 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.
-