public abstract class AbstractElasticSearchIndexRequestBuilderFactory extends Object implements ElasticSearchIndexRequestBuilderFactory
ElasticSearchIndexRequestBuilderFactory.| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.lang.time.FastDateFormat |
fastDateFormat
FastDateFormat to use for index names
in getIndexName(String, long) |
df| Modifier | Constructor and Description |
|---|---|
protected |
AbstractElasticSearchIndexRequestBuilderFactory(org.apache.commons.lang.time.FastDateFormat fastDateFormat)
Constructor for subclasses
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
configure(ComponentConfiguration arg0) |
abstract void |
configure(Context arg0)
Request the implementing class to (re)configure itself.
|
org.elasticsearch.action.index.IndexRequestBuilder |
createIndexRequest(org.elasticsearch.client.Client client,
String indexPrefix,
String indexType,
Event event)
Creates and prepares an
IndexRequestBuilder from the supplied
Client via delegation to the subclass-hook template methods
getIndexName(String, long) and
prepareIndexRequest(IndexRequestBuilder, String, String, Event) |
protected String |
getIndexName(String indexPrefix,
long timestamp)
Gets the name of the index to use for an index request
|
protected abstract void |
prepareIndexRequest(org.elasticsearch.action.index.IndexRequestBuilder indexRequest,
String indexName,
String indexType,
Event event)
Prepares an ElasticSearch
IndexRequestBuilder instance |
protected final org.apache.commons.lang.time.FastDateFormat fastDateFormat
FastDateFormat to use for index names
in getIndexName(String, long)protected AbstractElasticSearchIndexRequestBuilderFactory(org.apache.commons.lang.time.FastDateFormat fastDateFormat)
fastDateFormat - FastDateFormat to use for index namespublic abstract void configure(Context arg0)
ConfigurableRequest 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 ConfigurableConfigurablepublic abstract void configure(ComponentConfiguration arg0)
configure in interface ConfigurableComponentConfigurableComponentpublic org.elasticsearch.action.index.IndexRequestBuilder createIndexRequest(org.elasticsearch.client.Client client,
String indexPrefix,
String indexType,
Event event)
throws IOException
IndexRequestBuilder from the supplied
Client via delegation to the subclass-hook template methods
getIndexName(String, long) and
prepareIndexRequest(IndexRequestBuilder, String, String, Event)createIndexRequest in interface ElasticSearchIndexRequestBuilderFactoryclient - ElasticSearch Client to prepare index fromindexPrefix - Prefix of index name to use -- as configured on the sinkindexType - Index type to use -- as configured on the sinkevent - Flume event to serialize and add to index requestIndexRequestBuilder instanceIOException - If an error occurs e.g. during serializationprotected String getIndexName(String indexPrefix, long timestamp)
indexPrefix - Prefix of index name to use -- as configured on the sinktimestamp - timestamp (millis) to format / useprotected abstract void prepareIndexRequest(org.elasticsearch.action.index.IndexRequestBuilder indexRequest,
String indexName,
String indexType,
Event event)
throws IOException
IndexRequestBuilder instanceindexRequest - The (empty) ElasticSearch IndexRequestBuilder to prepareindexName - Index name to use -- as per 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.