Package io.zeebe.exporter
Class ElasticsearchClient
- java.lang.Object
-
- io.zeebe.exporter.ElasticsearchClient
-
public class ElasticsearchClient extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringALIAS_DELIMITERprotected org.elasticsearch.client.RestClientclientstatic StringINDEX_DELIMITERstatic StringINDEX_TEMPLATE_FILENAME_PATTERN
-
Constructor Summary
Constructors Constructor Description ElasticsearchClient(ElasticsearchExporterConfiguration configuration, org.slf4j.Logger log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbulk(Map<String,Object> command, Record<?> record)voidclose()voidflush()protected StringidFor(Record<?> record)voidindex(Record<?> record)protected StringindexFor(Record<?> record)protected StringindexPrefixForValueTypeWithDelimiter(ValueType valueType)booleanputIndexTemplate(ValueType valueType)booleanputIndexTemplate(String templateName, String aliasName, String filename)booleanshouldFlush()protected StringtypeFor(Record<?> record)
-
-
-
Field Detail
-
INDEX_TEMPLATE_FILENAME_PATTERN
public static final String INDEX_TEMPLATE_FILENAME_PATTERN
- See Also:
- Constant Field Values
-
INDEX_DELIMITER
public static final String INDEX_DELIMITER
- See Also:
- Constant Field Values
-
ALIAS_DELIMITER
public static final String ALIAS_DELIMITER
- See Also:
- Constant Field Values
-
client
protected final org.elasticsearch.client.RestClient client
-
-
Constructor Detail
-
ElasticsearchClient
public ElasticsearchClient(ElasticsearchExporterConfiguration configuration, org.slf4j.Logger log)
-
-
Method Detail
-
close
public void close() throws IOException- Throws:
IOException
-
index
public void index(Record<?> record)
-
flush
public void flush()
- Throws:
ElasticsearchExporterException- if not all items of the bulk were flushed successfully
-
shouldFlush
public boolean shouldFlush()
-
putIndexTemplate
public boolean putIndexTemplate(ValueType valueType)
- Returns:
- true if request was acknowledged
-
putIndexTemplate
public boolean putIndexTemplate(String templateName, String aliasName, String filename)
- Returns:
- true if request was acknowledged
-
-