|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.flume.sink.elasticsearch.client.ElasticSearchRestClient
public class ElasticSearchRestClient
Rest ElasticSearch client which is responsible for sending bulks of events to ElasticSearch using ElasticSearch HTTP API. This is configurable, so any config params required should be taken through this.
Constructor Summary | |
---|---|
ElasticSearchRestClient(String[] hostNames,
ElasticSearchEventSerializer serializer)
|
|
ElasticSearchRestClient(String[] hostNames,
ElasticSearchEventSerializer serializer,
org.apache.http.client.HttpClient client)
|
Method Summary | |
---|---|
void |
addEvent(Event event,
IndexNameBuilder indexNameBuilder,
String indexType,
long ttlMs)
Add new event to the bulk |
void |
close()
Close connection to elastic search in client |
void |
configure(Context context)
Request the implementing class to (re)configure itself. |
void |
execute()
Sends bulk to the elasticsearch cluster |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ElasticSearchRestClient(String[] hostNames, ElasticSearchEventSerializer serializer)
public ElasticSearchRestClient(String[] hostNames, ElasticSearchEventSerializer serializer, org.apache.http.client.HttpClient client)
Method Detail |
---|
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 guarrantees on when configure might be called.
configure
in interface Configurable
public void close()
ElasticSearchClient
close
in interface ElasticSearchClient
public void addEvent(Event event, IndexNameBuilder indexNameBuilder, String indexType, long ttlMs) throws Exception
ElasticSearchClient
addEvent
in interface ElasticSearchClient
event
- Flume EventindexNameBuilder
- Index name builder which generates name of index to feedindexType
- Name of type of document which will be sent to the elasticsearch clusterttlMs
- Time to live expressed in milliseconds. Value <= 0 is ignored
Exception
public void execute() throws Exception
ElasticSearchClient
execute
in interface ElasticSearchClient
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |