public class EventSerializerIndexRequestBuilderFactory extends AbstractElasticSearchIndexRequestBuilderFactory
ElasticSearchIndexRequestBuilderFactory
.
It serializes flume events using the
ElasticSearchEventSerializer
instance configured on the sink.Modifier and Type | Field and Description |
---|---|
protected ElasticSearchEventSerializer |
serializer |
fastDateFormat
df
Modifier | Constructor and Description |
---|---|
|
EventSerializerIndexRequestBuilderFactory(ElasticSearchEventSerializer serializer) |
protected |
EventSerializerIndexRequestBuilderFactory(ElasticSearchEventSerializer serializer,
org.apache.commons.lang.time.FastDateFormat fdf) |
Modifier and Type | Method and Description |
---|---|
void |
configure(ComponentConfiguration config) |
void |
configure(Context context)
Request the implementing class to (re)configure itself.
|
protected void |
prepareIndexRequest(org.elasticsearch.action.index.IndexRequestBuilder indexRequest,
String indexName,
String indexType,
Event event)
Prepares an ElasticSearch
IndexRequestBuilder instance |
createIndexRequest, getIndexName
protected final ElasticSearchEventSerializer serializer
public EventSerializerIndexRequestBuilderFactory(ElasticSearchEventSerializer serializer)
protected EventSerializerIndexRequestBuilderFactory(ElasticSearchEventSerializer serializer, org.apache.commons.lang.time.FastDateFormat fdf)
public void configure(Context context)
Configurable
Request the implementing class to (re)configure itself.
When configuration parameters are changed, they must be reflected by the component asap.
There are no thread safety guarantees on when configure might be called.
configure
in interface Configurable
configure
in class AbstractElasticSearchIndexRequestBuilderFactory
Configurable
public void configure(ComponentConfiguration config)
configure
in interface ConfigurableComponent
configure
in class AbstractElasticSearchIndexRequestBuilderFactory
ConfigurableComponent
protected void prepareIndexRequest(org.elasticsearch.action.index.IndexRequestBuilder indexRequest, String indexName, String indexType, Event event) throws IOException
AbstractElasticSearchIndexRequestBuilderFactory
IndexRequestBuilder
instanceprepareIndexRequest
in class AbstractElasticSearchIndexRequestBuilderFactory
indexRequest
- The (empty) ElasticSearch IndexRequestBuilder
to prepareindexName
- Index name to use -- as per AbstractElasticSearchIndexRequestBuilderFactory.getIndexName(String, long)
indexType
- Index type to use -- as configured on the sinkevent
- Flume event to serialize and add to index requestIOException
- If an error occurs e.g. during serializationCopyright © 2009-2016 Apache Software Foundation. All Rights Reserved.