public class ReindexManagerImpl extends Object implements ReindexManager
Modifier and Type | Field and Description |
---|---|
protected ElasticsearchClient |
elasticsearchClient |
protected IndexManager |
indexManager |
protected ProcessEngineConfiguration |
processEngineConfiguration |
protected ReindexingProperties |
reindexingProperties |
Constructor and Description |
---|
ReindexManagerImpl(IndexManager indexManager,
ElasticsearchClient elasticsearchClient,
ReindexingProperties reindexingProperties) |
Modifier and Type | Method and Description |
---|---|
ProcessEngineConfiguration |
getProcessEngineConfiguration() |
void |
reindex(String alias,
Collection<ReindexEntityPageHandler> reindexEntityPageHandlers)
Uses
ReindexEntityPageHandler (s) to reindex data, page by page. |
void |
reindex(String alias,
ReindexRunnable reindexRunnable)
Executes the provided
ReindexRunnable (containing the actual reindex logic), while taking care before
and after the execution to properly housekeep the indices:
1. |
void |
setProcessEngineConfiguration(ProcessEngineConfiguration processEngineConfiguration) |
protected boolean |
waitForIndexJobsToBeProcessed() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
reindex
protected IndexManager indexManager
protected ReindexingProperties reindexingProperties
protected ElasticsearchClient elasticsearchClient
protected ProcessEngineConfiguration processEngineConfiguration
public ReindexManagerImpl(IndexManager indexManager, ElasticsearchClient elasticsearchClient, ReindexingProperties reindexingProperties)
public void reindex(String alias, ReindexRunnable reindexRunnable)
ReindexManager
ReindexRunnable
(containing the actual reindex logic), while taking care before
and after the execution to properly housekeep the indices:
1. String originalIndexName = getTheRealIndexName
2. Delete the alias for the index
3. create a new index (with prefix)
4. Execute custom reindex logic
5. Delete the original index
Uses a generic ReindexRunnable
that can contain any logic.reindex
in interface ReindexManager
public void reindex(String alias, Collection<ReindexEntityPageHandler> reindexEntityPageHandlers)
ReindexManager
ReindexEntityPageHandler
(s) to reindex data, page by page.
Internally, a new ReindexRunnable
will be created and the ReindexManager.reindex(String, ReindexRunnable)
will be called.reindex
in interface ReindexManager
protected boolean waitForIndexJobsToBeProcessed()
public ProcessEngineConfiguration getProcessEngineConfiguration()
public void setProcessEngineConfiguration(ProcessEngineConfiguration processEngineConfiguration)