Class ElasticsearchConnection
- java.lang.Object
-
- de.pangaea.metadataportal.processor.ElasticsearchConnection
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class ElasticsearchConnection extends Object implements Closeable
TODO- Author:
- Uwe Schindler
-
-
Field Summary
Fields Modifier and Type Field Description static intELASTICSEARCH_DEFAULT_PORT
-
Constructor Summary
Constructors Constructor Description ElasticsearchConnection(Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.elasticsearch.client.Clientclient()voidclose()voidcloseIndex(TargetIndexConfig ticonf, String realIndexName, boolean cleanShutdown)Closes the index after harvesting and update the aliases to point to the active index.StringcreateIndex(TargetIndexConfig ticonf, boolean rebuilder)Creates the index (if needed), configures it (mapping), and creates aliases.DocumentProcessorgetDocumentProcessor(HarvesterConfig iconfig, String targetIndex)voidupdateAliases(TargetIndexConfig ticonf)Closes the index after harvesting and update the aliases to point to the active index.voidwaitForYellow(TargetIndexConfig ticonf)
-
-
-
Field Detail
-
ELASTICSEARCH_DEFAULT_PORT
public static final int ELASTICSEARCH_DEFAULT_PORT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ElasticsearchConnection
public ElasticsearchConnection(Config config)
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
client
public org.elasticsearch.client.Client client()
-
getDocumentProcessor
public DocumentProcessor getDocumentProcessor(HarvesterConfig iconfig, String targetIndex)
-
waitForYellow
public void waitForYellow(TargetIndexConfig ticonf)
-
createIndex
public String createIndex(TargetIndexConfig ticonf, boolean rebuilder)
Creates the index (if needed), configures it (mapping), and creates aliases. The real index name to be used is returned.
-
closeIndex
public void closeIndex(TargetIndexConfig ticonf, String realIndexName, boolean cleanShutdown)
Closes the index after harvesting and update the aliases to point to the active index.
-
updateAliases
public void updateAliases(TargetIndexConfig ticonf)
Closes the index after harvesting and update the aliases to point to the active index.
-
-