public class ElasticSearchAdminImpl extends Object implements ElasticSearchAdmin
Constructor and Description |
---|
ElasticSearchAdminImpl(ElasticSearchLocalConfig localConfig,
ElasticSearchRemoteConfig remoteConfig,
Map<String,ElasticSearchIndexConfig> indexConfig)
Init the admin service, remote configuration if not null will take precedence over local embedded configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
disconnect() |
void |
dropAndInitIndex(String indexName)
Reinitialize an index.
|
void |
dropAndInitRepositoryIndex(String repositoryName)
Reinitialize the index of a repository.
|
void |
flush()
Elasticsearch flush on all document indexes, triggers a lucene commit, empties the transaction log.
|
void |
flushRepositoryIndex(String repositoryName)
Elasticsearch flush on document index for a specific repository, triggers a lucene commit, empties the
transaction log.
|
org.elasticsearch.client.Client |
getClient()
Retrieves the
Client that can be used to access Elasticsearch API |
String |
getIndexNameForRepository(String repositoryName)
Get the index name associated with the repository name.
|
String |
getIndexNameForType(String type)
Get the first index name with the given type.
|
List<String> |
getIndexNamesForType(String type)
Get the index names with the given type.
|
List<String> |
getInitializedRepositories()
Get the list of repository names that have their index created.
|
int |
getPendingWorkerCount()
Returns the number of indexing worker scheduled waiting to be executed.
|
List<String> |
getRepositoryNames()
List repository names that have Elasticsearch support.
|
int |
getRunningWorkerCount()
Returns the number of indexing worker that are currently running.
|
int |
getTotalCommandProcessed()
Returns the total number of command processed by Elasticsearch for this Nuxeo instance.
|
void |
initIndexes(boolean dropIfExists)
Initialize Elasticsearch indexes.
|
boolean |
isEmbedded()
Returns true if the Elasticsearch is embedded with Nuxeo, sharing the same JVM.
|
boolean |
isIndexingInProgress()
Returns true if there are indexing activities scheduled or running.
|
boolean |
isReady() |
void |
optimize()
Elasticsearch run
ElasticSearchAdmin.optimizeRepositoryIndex(java.lang.String) on all document indexes, |
void |
optimizeIndex(String indexName)
Elasticsearch optimize operation allows to reduce the number of segments to one, Note that this can potentially
be a very heavy operation.
|
void |
optimizeRepositoryIndex(String repositoryName)
Elasticsearch optimize operation allows to reduce the number of segments to one, Note that this can potentially
be a very heavy operation.
|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
prepareWaitForIndexing()
A
Future that accepts callback on completion when all the indexing worker are done. |
void |
refresh()
Refresh all document indexes, immediately after the operation occurs, so that the updated document appears in
search results immediately.
|
void |
refreshRepositoryIndex(String repositoryName)
Refresh document index for the specific repository, immediately after the operation occurs, so that the updated
document appears in search results immediately.
|
public ElasticSearchAdminImpl(ElasticSearchLocalConfig localConfig, ElasticSearchRemoteConfig remoteConfig, Map<String,ElasticSearchIndexConfig> indexConfig)
public void disconnect()
public void refreshRepositoryIndex(String repositoryName)
ElasticSearchAdmin
refreshRepositoryIndex
in interface ElasticSearchAdmin
public String getIndexNameForRepository(String repositoryName)
ElasticSearchAdmin
getIndexNameForRepository
in interface ElasticSearchAdmin
public List<String> getIndexNamesForType(String type)
ElasticSearchAdmin
getIndexNamesForType
in interface ElasticSearchAdmin
public String getIndexNameForType(String type)
ElasticSearchAdmin
getIndexNameForType
in interface ElasticSearchAdmin
public void flushRepositoryIndex(String repositoryName)
ElasticSearchAdmin
flushRepositoryIndex
in interface ElasticSearchAdmin
public void refresh()
ElasticSearchAdmin
refresh
in interface ElasticSearchAdmin
public void flush()
ElasticSearchAdmin
flush
in interface ElasticSearchAdmin
public void optimizeIndex(String indexName)
ElasticSearchAdmin
optimizeIndex
in interface ElasticSearchAdmin
public void optimizeRepositoryIndex(String repositoryName)
ElasticSearchAdmin
optimizeRepositoryIndex
in interface ElasticSearchAdmin
public void optimize()
ElasticSearchAdmin
ElasticSearchAdmin.optimizeRepositoryIndex(java.lang.String)
on all document indexes,optimize
in interface ElasticSearchAdmin
public org.elasticsearch.client.Client getClient()
ElasticSearchAdmin
Client
that can be used to access Elasticsearch APIgetClient
in interface ElasticSearchAdmin
public void initIndexes(boolean dropIfExists)
ElasticSearchAdmin
initIndexes
in interface ElasticSearchAdmin
dropIfExists
- if {true} remove an existing indexpublic void dropAndInitIndex(String indexName)
ElasticSearchAdmin
dropAndInitIndex
in interface ElasticSearchAdmin
public void dropAndInitRepositoryIndex(String repositoryName)
ElasticSearchAdmin
dropAndInitRepositoryIndex
in interface ElasticSearchAdmin
public List<String> getRepositoryNames()
ElasticSearchAdmin
getRepositoryNames
in interface ElasticSearchAdmin
public int getPendingWorkerCount()
ElasticSearchAdmin
getPendingWorkerCount
in interface ElasticSearchAdmin
public int getRunningWorkerCount()
ElasticSearchAdmin
getRunningWorkerCount
in interface ElasticSearchAdmin
public int getTotalCommandProcessed()
ElasticSearchAdmin
getTotalCommandProcessed
in interface ElasticSearchAdmin
public boolean isEmbedded()
ElasticSearchAdmin
isEmbedded
in interface ElasticSearchAdmin
public boolean isIndexingInProgress()
ElasticSearchAdmin
isIndexingInProgress
in interface ElasticSearchAdmin
public com.google.common.util.concurrent.ListenableFuture<Boolean> prepareWaitForIndexing()
ElasticSearchAdmin
Future
that accepts callback on completion when all the indexing worker are done.prepareWaitForIndexing
in interface ElasticSearchAdmin
public boolean isReady()
public List<String> getInitializedRepositories()
Copyright © 2015 Nuxeo SA. All rights reserved.