org.apache.flume.sink.elasticsearch.client
Class ElasticSearchClientFactory
java.lang.Object
org.apache.flume.sink.elasticsearch.client.ElasticSearchClientFactory
public class ElasticSearchClientFactory
- extends Object
Internal ElasticSearch client factory. Responsible for creating instance
of ElasticSearch clients.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransportClient
public static final String TransportClient
- See Also:
- Constant Field Values
RestClient
public static final String RestClient
- See Also:
- Constant Field Values
ElasticSearchClientFactory
public ElasticSearchClientFactory()
getClient
public ElasticSearchClient getClient(String clientType,
String[] hostNames,
String clusterName,
ElasticSearchEventSerializer serializer,
ElasticSearchIndexRequestBuilderFactory indexBuilder)
throws org.apache.flume.sink.elasticsearch.client.NoSuchClientTypeException
- Parameters:
clientType
- String representation of client typehostNames
- Array of strings that represents hosntames with ports (hostname:port)clusterName
- Elasticsearch cluster name used only by Transport Clientserializer
- Serializer of flume events to elasticsearch documents
- Returns:
-
- Throws:
org.apache.flume.sink.elasticsearch.client.NoSuchClientTypeException
getLocalClient
public ElasticSearchClient getLocalClient(String clientType,
ElasticSearchEventSerializer serializer,
ElasticSearchIndexRequestBuilderFactory indexBuilder)
throws org.apache.flume.sink.elasticsearch.client.NoSuchClientTypeException
- Used for tests only. Creates local elasticsearch instance client.
- Parameters:
clientType
- Name of client to useserializer
- Serializer for the eventindexBuilder
- Index builder factory
- Returns:
- Local elastic search instance client
- Throws:
org.apache.flume.sink.elasticsearch.client.NoSuchClientTypeException
Copyright © 2009-2015 Apache Software Foundation. All Rights Reserved.