|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.flume.sink.elasticsearch.AbstractElasticSearchIndexRequestBuilderFactory
public abstract class AbstractElasticSearchIndexRequestBuilderFactory
Abstract base class for custom implementations of
ElasticSearchIndexRequestBuilderFactory.
| Field Summary | |
|---|---|
protected org.apache.commons.lang.time.FastDateFormat |
fastDateFormat
FastDateFormat to use for index names
in getIndexName(String, long) |
| Fields inherited from interface org.apache.flume.sink.elasticsearch.ElasticSearchIndexRequestBuilderFactory |
|---|
df |
| Constructor Summary | |
|---|---|
protected |
AbstractElasticSearchIndexRequestBuilderFactory(org.apache.commons.lang.time.FastDateFormat fastDateFormat)
Constructor for subclasses |
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.lang.time.FastDateFormat fastDateFormat
FastDateFormat to use for index names
in getIndexName(String, long)
| Constructor Detail |
|---|
protected AbstractElasticSearchIndexRequestBuilderFactory(org.apache.commons.lang.time.FastDateFormat fastDateFormat)
fastDateFormat - FastDateFormat to use for index names| Method Detail |
|---|
public 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 guarrantees on when configure might be called.
configure in interface ConfigurableConfigurablepublic abstract void configure(ComponentConfiguration arg0)
configure in interface ConfigurableComponentConfigurableComponent
public 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 request
IndexRequestBuilder instance
IOException - If an error occurs e.g. during serialization
protected String getIndexName(String indexPrefix,
long timestamp)
indexPrefix - Prefix of index name to use -- as configured on the sinktimestamp - timestamp (millis) to format / use
protected abstract void prepareIndexRequest(org.elasticsearch.action.index.IndexRequestBuilder indexRequest,
String indexName,
String indexType,
Event event)
throws IOException
IndexRequestBuilder instance
indexRequest - 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 request
IOException - If an error occurs e.g. during serialization
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||