org.apache.flume.sink.elasticsearch
Class EventSerializerIndexRequestBuilderFactory
java.lang.Object
org.apache.flume.sink.elasticsearch.AbstractElasticSearchIndexRequestBuilderFactory
org.apache.flume.sink.elasticsearch.EventSerializerIndexRequestBuilderFactory
- All Implemented Interfaces:
- Configurable, ConfigurableComponent, ElasticSearchIndexRequestBuilderFactory
public class EventSerializerIndexRequestBuilderFactory
- extends AbstractElasticSearchIndexRequestBuilderFactory
Default implementation of ElasticSearchIndexRequestBuilderFactory
.
It serializes flume events using the
ElasticSearchEventSerializer
instance configured on the sink.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serializer
protected final ElasticSearchEventSerializer serializer
EventSerializerIndexRequestBuilderFactory
public EventSerializerIndexRequestBuilderFactory(ElasticSearchEventSerializer serializer)
EventSerializerIndexRequestBuilderFactory
protected EventSerializerIndexRequestBuilderFactory(ElasticSearchEventSerializer serializer,
org.apache.commons.lang.time.FastDateFormat fdf)
configure
public void configure(Context context)
- Description copied from interface:
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 guarrantees on when configure might be called.
- Specified by:
configure
in interface Configurable
- Specified by:
configure
in class AbstractElasticSearchIndexRequestBuilderFactory
- See Also:
Configurable
configure
public void configure(ComponentConfiguration config)
- Specified by:
configure
in interface ConfigurableComponent
- Specified by:
configure
in class AbstractElasticSearchIndexRequestBuilderFactory
- See Also:
ConfigurableComponent
prepareIndexRequest
protected void prepareIndexRequest(org.elasticsearch.action.index.IndexRequestBuilder indexRequest,
String indexName,
String indexType,
Event event)
throws IOException
- Description copied from class:
AbstractElasticSearchIndexRequestBuilderFactory
- Prepares an ElasticSearch
IndexRequestBuilder
instance
- Specified by:
prepareIndexRequest
in class AbstractElasticSearchIndexRequestBuilderFactory
- Parameters:
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 request
- Throws:
IOException
- If an error occurs e.g. during serialization
Copyright © 2009-2015 Apache Software Foundation. All Rights Reserved.