public class OttcElasticSearchComponent extends org.nuxeo.runtime.model.DefaultComponent implements OttcElasticSearchAdmin, OttcElasticSearchIndexing, OttcElasticSearchService
| Modifier and Type | Field and Description |
|---|---|
static String |
EP_INDEX |
protected org.nuxeo.ecm.automation.jaxrs.io.documents.JsonESDocumentWriter |
jsonESDocumentWriter |
| Constructor and Description |
|---|
OttcElasticSearchComponent() |
| Modifier and Type | Method and Description |
|---|---|
void |
applicationStarted(org.nuxeo.runtime.model.ComponentContext context) |
void |
deactivate(org.nuxeo.runtime.model.ComponentContext context) |
protected void |
dispatchWork(List<org.nuxeo.elasticsearch.commands.IndexingCommand> cmds)
Dispatch jobs between sync and async worker
|
void |
dropAndInitIndex(String indexName) |
void |
dropAndInitRepositoryIndex(String repositoryName) |
void |
flush() |
void |
flushRepositoryIndex(String repositoryName) |
int |
getApplicationStartedOrder() |
org.elasticsearch.client.Client |
getClient() |
String |
getConfiguredIndexOrAliasNameForRepository(String repositoryName) |
OttcElasticSearchAdminImpl |
getElasticSearchAdmin() |
OttcElasticSearchServiceImpl |
getEsService() |
String |
getIndexNameForRepository(String repositoryName) |
Map<String,String> |
getIndexNames() |
int |
getPendingWorkerCount() |
Map<String,String> |
getRepoNames() |
List<String> |
getRepositoryNames() |
int |
getRunningWorkerCount() |
int |
getTotalCommandProcessed() |
void |
indexNonRecursive(org.nuxeo.elasticsearch.commands.IndexingCommand cmd) |
void |
indexNonRecursive(List<org.nuxeo.elasticsearch.commands.IndexingCommand> cmds) |
void |
initIndexes(boolean dropIfExists) |
protected void |
initListenerThreadPool() |
protected boolean |
isElasticsearchEnabled() |
boolean |
isEmbedded() |
boolean |
isIndexingInProgress() |
boolean |
isZeroDownTimeReIndexingInProgress(String repository) |
void |
optimize() |
void |
optimizeIndex(String indexName) |
void |
optimizeRepositoryIndex(String repositoryName) |
com.google.common.util.concurrent.ListenableFuture<Boolean> |
prepareWaitForIndexing() |
org.nuxeo.ecm.core.api.DocumentModelList |
query(org.nuxeo.ecm.core.api.CoreSession session,
org.elasticsearch.index.query.QueryBuilder queryBuilder,
int limit,
int offset,
org.nuxeo.ecm.core.api.SortInfo... sortInfos)
Deprecated.
|
org.nuxeo.ecm.core.api.DocumentModelList |
query(org.nuxeo.ecm.core.api.CoreSession session,
String nxql,
int limit,
int offset,
org.nuxeo.ecm.core.api.SortInfo... sortInfos)
Deprecated.
|
org.nuxeo.ecm.core.api.DocumentModelList |
query(org.nuxeo.elasticsearch.query.NxQueryBuilder queryBuilder) |
org.nuxeo.elasticsearch.api.EsResult |
queryAndAggregate(org.nuxeo.elasticsearch.query.NxQueryBuilder queryBuilder) |
void |
refresh() |
void |
refreshRepositoryIndex(String repositoryName) |
void |
registerContribution(Object contribution,
String extensionPoint,
org.nuxeo.runtime.model.ComponentInstance contributor) |
boolean |
reIndexAllDocumentsWithZeroDownTime(String repository)
Re-index all documents of given repository in Elasticsearch with zero down time.
|
protected void |
runIndexingSyncWorker(Map<String,List<org.nuxeo.elasticsearch.commands.IndexingCommand>> syncCommands) |
void |
runIndexingWorker(List<org.nuxeo.elasticsearch.commands.IndexingCommand> cmds) |
void |
runReindexingWorker(String repositoryName,
String nxql) |
void |
runReindexingWorker(String repositoryName,
String nxql,
boolean zeroDownTime) |
protected void |
scheduleIndexingAsyncWorker(Map<String,List<org.nuxeo.elasticsearch.commands.IndexingCommand>> asyncCommands) |
protected void |
stackCommands(List<org.nuxeo.elasticsearch.commands.IndexingCommand> cmds) |
boolean |
useExternalVersion() |
public static final String EP_INDEX
protected org.nuxeo.ecm.automation.jaxrs.io.documents.JsonESDocumentWriter jsonESDocumentWriter
public void registerContribution(Object contribution, String extensionPoint, org.nuxeo.runtime.model.ComponentInstance contributor)
registerContribution in class org.nuxeo.runtime.model.DefaultComponentpublic void applicationStarted(org.nuxeo.runtime.model.ComponentContext context)
throws InterruptedException,
ExecutionException
applicationStarted in interface org.nuxeo.runtime.model.ComponentapplicationStarted in class org.nuxeo.runtime.model.DefaultComponentInterruptedExceptionExecutionExceptionprotected boolean isElasticsearchEnabled()
public void deactivate(org.nuxeo.runtime.model.ComponentContext context)
deactivate in interface org.nuxeo.runtime.model.Componentdeactivate in class org.nuxeo.runtime.model.DefaultComponentpublic int getApplicationStartedOrder()
getApplicationStartedOrder in interface org.nuxeo.runtime.model.ComponentgetApplicationStartedOrder in class org.nuxeo.runtime.model.DefaultComponentpublic OttcElasticSearchAdminImpl getElasticSearchAdmin()
public org.elasticsearch.client.Client getClient()
getClient in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic Map<String,String> getIndexNames()
getIndexNames in interface OttcElasticSearchAdminpublic Map<String,String> getRepoNames()
getRepoNames in interface OttcElasticSearchAdminpublic void initIndexes(boolean dropIfExists)
initIndexes in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic void dropAndInitIndex(String indexName)
dropAndInitIndex in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic void dropAndInitRepositoryIndex(String repositoryName)
dropAndInitRepositoryIndex in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic List<String> getRepositoryNames()
getRepositoryNames in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic String getIndexNameForRepository(String repositoryName)
getIndexNameForRepository in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic int getPendingWorkerCount()
getPendingWorkerCount in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic int getRunningWorkerCount()
getRunningWorkerCount in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic int getTotalCommandProcessed()
getTotalCommandProcessed in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic boolean isEmbedded()
isEmbedded in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic boolean useExternalVersion()
useExternalVersion in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic boolean isIndexingInProgress()
isIndexingInProgress in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic com.google.common.util.concurrent.ListenableFuture<Boolean> prepareWaitForIndexing()
prepareWaitForIndexing in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminprotected void initListenerThreadPool()
public void refresh()
refresh in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic void refreshRepositoryIndex(String repositoryName)
refreshRepositoryIndex in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic void flush()
flush in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic void flushRepositoryIndex(String repositoryName)
flushRepositoryIndex in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic void optimize()
optimize in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic void optimizeRepositoryIndex(String repositoryName)
optimizeRepositoryIndex in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic void optimizeIndex(String indexName)
optimizeIndex in interface org.nuxeo.elasticsearch.api.ElasticSearchAdminpublic void indexNonRecursive(org.nuxeo.elasticsearch.commands.IndexingCommand cmd)
throws org.nuxeo.ecm.core.api.ClientException
indexNonRecursive in interface org.nuxeo.elasticsearch.api.ElasticSearchIndexingorg.nuxeo.ecm.core.api.ClientExceptionpublic void indexNonRecursive(List<org.nuxeo.elasticsearch.commands.IndexingCommand> cmds) throws org.nuxeo.ecm.core.api.ClientException
indexNonRecursive in interface org.nuxeo.elasticsearch.api.ElasticSearchIndexingorg.nuxeo.ecm.core.api.ClientExceptionprotected void stackCommands(List<org.nuxeo.elasticsearch.commands.IndexingCommand> cmds)
public void runIndexingWorker(List<org.nuxeo.elasticsearch.commands.IndexingCommand> cmds)
runIndexingWorker in interface org.nuxeo.elasticsearch.api.ElasticSearchIndexingprotected void dispatchWork(List<org.nuxeo.elasticsearch.commands.IndexingCommand> cmds)
protected void scheduleIndexingAsyncWorker(Map<String,List<org.nuxeo.elasticsearch.commands.IndexingCommand>> asyncCommands)
protected void runIndexingSyncWorker(Map<String,List<org.nuxeo.elasticsearch.commands.IndexingCommand>> syncCommands)
public void runReindexingWorker(String repositoryName, String nxql)
runReindexingWorker in interface org.nuxeo.elasticsearch.api.ElasticSearchIndexingpublic void runReindexingWorker(String repositoryName, String nxql, boolean zeroDownTime)
public boolean reIndexAllDocumentsWithZeroDownTime(String repository) throws ReIndexingStatusException, ReIndexingStateException, ReIndexingException
OttcElasticSearchIndexingreIndexAllDocumentsWithZeroDownTime in interface OttcElasticSearchIndexingReIndexingExceptionReIndexingStatusExceptionReIndexingStateExceptionpublic boolean isZeroDownTimeReIndexingInProgress(String repository) throws InterruptedException
isZeroDownTimeReIndexingInProgress in interface OttcElasticSearchAdminInterruptedExceptionpublic OttcElasticSearchServiceImpl getEsService()
public String getConfiguredIndexOrAliasNameForRepository(String repositoryName)
getConfiguredIndexOrAliasNameForRepository in interface OttcElasticSearchAdminpublic org.nuxeo.ecm.core.api.DocumentModelList query(org.nuxeo.elasticsearch.query.NxQueryBuilder queryBuilder)
throws org.nuxeo.ecm.core.api.ClientException
query in interface org.nuxeo.elasticsearch.api.ElasticSearchServiceorg.nuxeo.ecm.core.api.ClientExceptionpublic org.nuxeo.elasticsearch.api.EsResult queryAndAggregate(org.nuxeo.elasticsearch.query.NxQueryBuilder queryBuilder)
throws org.nuxeo.ecm.core.api.ClientException
queryAndAggregate in interface org.nuxeo.elasticsearch.api.ElasticSearchServiceorg.nuxeo.ecm.core.api.ClientException@Deprecated public org.nuxeo.ecm.core.api.DocumentModelList query(org.nuxeo.ecm.core.api.CoreSession session, String nxql, int limit, int offset, org.nuxeo.ecm.core.api.SortInfo... sortInfos) throws org.nuxeo.ecm.core.api.ClientException
query in interface org.nuxeo.elasticsearch.api.ElasticSearchServiceorg.nuxeo.ecm.core.api.ClientException@Deprecated public org.nuxeo.ecm.core.api.DocumentModelList query(org.nuxeo.ecm.core.api.CoreSession session, org.elasticsearch.index.query.QueryBuilder queryBuilder, int limit, int offset, org.nuxeo.ecm.core.api.SortInfo... sortInfos) throws org.nuxeo.ecm.core.api.ClientException
query in interface org.nuxeo.elasticsearch.api.ElasticSearchServiceorg.nuxeo.ecm.core.api.ClientExceptionCopyright © 2020. All rights reserved.