public class ElasticSearchClientFactory extends Object
Modifier and Type | Field and Description |
---|---|
static String |
RestClient |
static String |
TransportClient |
Constructor and Description |
---|
ElasticSearchClientFactory() |
Modifier and Type | Method and Description |
---|---|
ElasticSearchClient |
getClient(String clientType,
String[] hostNames,
String clusterName,
ElasticSearchEventSerializer serializer,
ElasticSearchIndexRequestBuilderFactory indexBuilder) |
ElasticSearchClient |
getLocalClient(String clientType,
ElasticSearchEventSerializer serializer,
ElasticSearchIndexRequestBuilderFactory indexBuilder)
Used for tests only.
|
public static final String TransportClient
public static final String RestClient
public ElasticSearchClient getClient(String clientType, String[] hostNames, String clusterName, ElasticSearchEventSerializer serializer, ElasticSearchIndexRequestBuilderFactory indexBuilder) throws org.apache.flume.sink.elasticsearch.client.NoSuchClientTypeException
clientType
- String representation of client typehostNames
- Array of strings that represents hostnames with ports (hostname:port)clusterName
- Elasticsearch cluster name used only by Transport Clientserializer
- Serializer of flume events to elasticsearch documentsorg.apache.flume.sink.elasticsearch.client.NoSuchClientTypeException
public ElasticSearchClient getLocalClient(String clientType, ElasticSearchEventSerializer serializer, ElasticSearchIndexRequestBuilderFactory indexBuilder) throws org.apache.flume.sink.elasticsearch.client.NoSuchClientTypeException
clientType
- Name of client to useserializer
- Serializer for the eventindexBuilder
- Index builder factoryorg.apache.flume.sink.elasticsearch.client.NoSuchClientTypeException
Copyright © 2009-2016 Apache Software Foundation. All Rights Reserved.