public class MultiElasticsearchAdminServiceImpl extends ElasticsearchAdminServiceImpl
ElasticsearchAdminServiceImpl that handles multiple Elasticsearch clusters| Modifier and Type | Field and Description |
|---|---|
protected org.elasticsearch.client.RestHighLevelClient[] |
writeClients
Elasticsearch clients used for write-related operations
|
authoringIndexSettings, DEFAULT_INDEX_NAME_SUFFIX, elasticsearchClient, indexNameSuffix, previewIndexSettings| Constructor and Description |
|---|
MultiElasticsearchAdminServiceImpl(org.springframework.core.io.Resource authoringIndexSettings,
org.springframework.core.io.Resource previewIndexSettings,
org.elasticsearch.client.RestHighLevelClient readClient,
org.elasticsearch.client.RestHighLevelClient[] writeClients) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
createIndex(String aliasName,
boolean isAuthoring)
Creates an index
|
void |
deleteIndexes(String aliasName)
Deletes all indexes assigned to the given alias
|
void |
recreateIndex(String aliasName,
boolean isAuthoring)
Recreates an existing index
|
void |
waitUntilReady()
Checks if the Elasticsearch cluster is ready to receive requests
|
doCreateIndex, doCreateIndexAndAlias, doCreateIndexAndAlias, doDeleteIndex, doDeleteIndexes, doGetIndexName, doRecreateIndex, doReindex, doSwap, doWaitUntilReady, exists, setIndexNameSuffixprotected org.elasticsearch.client.RestHighLevelClient[] writeClients
public MultiElasticsearchAdminServiceImpl(org.springframework.core.io.Resource authoringIndexSettings,
org.springframework.core.io.Resource previewIndexSettings,
org.elasticsearch.client.RestHighLevelClient readClient,
org.elasticsearch.client.RestHighLevelClient[] writeClients)
public void createIndex(String aliasName, boolean isAuthoring) throws ElasticsearchException
createIndex in interface ElasticsearchAdminServicecreateIndex in class ElasticsearchAdminServiceImplaliasName - the name of the aliasisAuthoring - indicates if the index is for authoringElasticsearchException - if there is any error during the operationpublic void deleteIndexes(String aliasName) throws ElasticsearchException
deleteIndexes in interface ElasticsearchAdminServicedeleteIndexes in class ElasticsearchAdminServiceImplaliasName - the name of the aliasElasticsearchException - if there is any error during the operationpublic void recreateIndex(String aliasName, boolean isAuthoring) throws ElasticsearchException
ElasticsearchAdminServiceImplrecreateIndex in interface ElasticsearchAdminServicerecreateIndex in class ElasticsearchAdminServiceImplaliasName - the name of the aliasisAuthoring - indicates if the index is for authoringElasticsearchException - if there is any error during the operationpublic void waitUntilReady()
ElasticsearchAdminServicewaitUntilReady in interface ElasticsearchAdminServicewaitUntilReady in class ElasticsearchAdminServiceImplpublic void close()
throws Exception
close in interface AutoCloseableclose in class ElasticsearchAdminServiceImplExceptionCopyright © 2020 CrafterCMS. All rights reserved.