I - type of error eventO - in case of retries, this is the type of the retry valueC - the type of error collector usedpublic class ElasticsearchHandler<I extends Exceptional,O,C extends ErrorCollector<O>> extends Object implements ErrorHandler<I,O,C>
Handler results returned from this handler are configurable; In the case that the event is successfully written to Elasticsearch it returns HANDLED by default and if the event cannot be written for any reason it returns ABORT by default.
| Modifier and Type | Field and Description |
|---|---|
static String |
CONF_CLIENT_CONF |
static String |
CONF_CLIENT_INHERIT |
static String |
CONF_CLIENT_NODES |
static String |
CONF_CLIENT_PORT |
static String |
CONF_CLIENT_RESOURCE |
static String |
CONF_LABEL |
static String |
CONF_PASS_REASON_SUFFIX |
static String |
CONF_RETURN_ERROR |
static String |
CONF_RETURN_ERROR_DEFAULT |
static String |
CONF_RETURN_VALUE |
static String |
CONF_RETURN_VALUE_DEFAULT |
static String |
CONF_TAGS |
| Constructor and Description |
|---|
ElasticsearchHandler(Settings rootSettings,
EventConverter<I> eventConverter) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Called at the close of the connector to clean up any internal resources.
|
static <I extends Exceptional,O,C extends ErrorCollector<O>> |
create(Settings rootSettings,
EventConverter<I> converter) |
void |
init(Properties properties)
Called at the handler creation time to initialize any internal state or resources.
|
HandlerResult |
onError(I entry,
C collector)
Called when an exception or failure occurs in a part of the connector.
|
public static final String CONF_RETURN_VALUE
public static final String CONF_RETURN_VALUE_DEFAULT
public static final String CONF_RETURN_ERROR
public static final String CONF_RETURN_ERROR_DEFAULT
public static final String CONF_PASS_REASON_SUFFIX
public static final String CONF_LABEL
public static final String CONF_TAGS
public static final String CONF_CLIENT_NODES
public static final String CONF_CLIENT_PORT
public static final String CONF_CLIENT_RESOURCE
public static final String CONF_CLIENT_INHERIT
public static final String CONF_CLIENT_CONF
public ElasticsearchHandler(Settings rootSettings, EventConverter<I> eventConverter)
public static <I extends Exceptional,O,C extends ErrorCollector<O>> ElasticsearchHandler<I,O,C> create(Settings rootSettings, EventConverter<I> converter)
public void init(Properties properties)
ErrorHandlerinit in interface ErrorHandler<I extends Exceptional,O,C extends ErrorCollector<O>>properties - Properties for this handler with handler name prefix stripped away.public HandlerResult onError(I entry, C collector) throws Exception
ErrorHandleronError in interface ErrorHandler<I extends Exceptional,O,C extends ErrorCollector<O>>entry - information about the failure, normally includes operational data and error informationcollector - handler for accepting user reactions to the failure, like retrying with modified parametersException - In the event that the current failure should not be handled, and should halt the connector
processing.public void close()
ErrorHandlerclose in interface ErrorHandler<I extends Exceptional,O,C extends ErrorCollector<O>>