public class ElasticSearchTransportClient extends Object implements ElasticSearchClient
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
logger |
Constructor and Description |
---|
ElasticSearchTransportClient(org.elasticsearch.client.Client client,
ElasticSearchEventSerializer serializer)
Used for testing
|
ElasticSearchTransportClient(org.elasticsearch.client.Client client,
ElasticSearchIndexRequestBuilderFactory requestBuilderFactory)
Used for testing
|
ElasticSearchTransportClient(ElasticSearchEventSerializer serializer)
Local transport client only for testing
|
ElasticSearchTransportClient(ElasticSearchIndexRequestBuilderFactory indexBuilderFactory)
Local transport client only for testing
|
ElasticSearchTransportClient(String[] hostNames,
String clusterName,
ElasticSearchEventSerializer serializer)
Transport client for external cluster
|
ElasticSearchTransportClient(String[] hostNames,
String clusterName,
ElasticSearchIndexRequestBuilderFactory indexBuilder) |
Modifier and Type | Method and Description |
---|---|
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
|
public ElasticSearchTransportClient(String[] hostNames, String clusterName, ElasticSearchEventSerializer serializer)
hostNames
- clusterName
- serializer
- public ElasticSearchTransportClient(String[] hostNames, String clusterName, ElasticSearchIndexRequestBuilderFactory indexBuilder)
public ElasticSearchTransportClient(ElasticSearchIndexRequestBuilderFactory indexBuilderFactory)
indexBuilderFactory
- public ElasticSearchTransportClient(ElasticSearchEventSerializer serializer)
serializer
- public ElasticSearchTransportClient(org.elasticsearch.client.Client client, ElasticSearchEventSerializer serializer)
client
- ElasticSearch Clientserializer
- Event Serializerpublic ElasticSearchTransportClient(org.elasticsearch.client.Client client, ElasticSearchIndexRequestBuilderFactory requestBuilderFactory) throws IOException
IOException
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 ignoredException
public void execute() throws Exception
ElasticSearchClient
execute
in interface ElasticSearchClient
Exception
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 guarantees on when configure might be called.
configure
in interface Configurable
Copyright © 2009-2017 Apache Software Foundation. All Rights Reserved.