org.apache.flume.sink.elasticsearch
Class ElasticSearchDynamicSerializer

java.lang.Object
  extended by org.apache.flume.sink.elasticsearch.ElasticSearchDynamicSerializer
All Implemented Interfaces:
Configurable, ConfigurableComponent, ElasticSearchEventSerializer

public class ElasticSearchDynamicSerializer
extends Object
implements ElasticSearchEventSerializer

Basic serializer that serializes the event body and header fields into individual fields

A best effort will be used to determine the content-type, if it cannot be determined fields will be indexed as Strings


Field Summary
 
Fields inherited from interface org.apache.flume.sink.elasticsearch.ElasticSearchEventSerializer
charset
 
Constructor Summary
ElasticSearchDynamicSerializer()
           
 
Method Summary
 void configure(ComponentConfiguration conf)
           
 void configure(Context context)
           Request the implementing class to (re)configure itself.
 org.elasticsearch.common.xcontent.XContentBuilder getContentBuilder(Event event)
          Return an BytesStream made up of the serialized flume event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElasticSearchDynamicSerializer

public ElasticSearchDynamicSerializer()
Method Detail

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

configure

public void configure(ComponentConfiguration conf)
Specified by:
configure in interface ConfigurableComponent

getContentBuilder

public org.elasticsearch.common.xcontent.XContentBuilder getContentBuilder(Event event)
                                                                    throws IOException
Description copied from interface: ElasticSearchEventSerializer
Return an BytesStream made up of the serialized flume event

Specified by:
getContentBuilder in interface ElasticSearchEventSerializer
Parameters:
event - The flume event to serialize
Returns:
A BytesStream used to write to ElasticSearch
Throws:
IOException - If an error occurs during serialization


Copyright © 2009-2013 Apache Software Foundation. All Rights Reserved.