Class ElasticIndexingOperationProcessor
java.lang.Object
org.exoplatform.commons.search.index.IndexingOperationProcessor
org.exoplatform.commons.search.index.impl.ElasticIndexingOperationProcessor
- All Implemented Interfaces:
org.picocontainer.Startable
public class ElasticIndexingOperationProcessor
extends IndexingOperationProcessor
implements org.picocontainer.Startable
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionElasticIndexingOperationProcessor(IndexingOperationDAO indexingOperationDAO, ElasticIndexingClient elasticIndexingClient, ElasticContentRequestBuilder elasticContentRequestBuilder, ElasticIndexingAuditTrail auditTrail, org.exoplatform.commons.persistence.impl.EntityManagerService entityManagerService, org.exoplatform.container.xml.InitParams initParams) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnector(IndexingServiceConnector indexingServiceConnector) Add Indexing Connector to the servicevoidaddConnector(IndexingServiceConnector indexingServiceConnector, Boolean override) Add Indexing Connector to the servicevoidSet the indexing process as interrupted in order to terminate it as soon as possible without finishing the whole process.voidprocess()Handle the Indexing queue Get all data in the indexing queue, transform them to ES requests, send requests to ES This method is ONLY called by the job scheduler.voidsetBatchNumber(Integer batchNumber) voidsetInitialized(boolean initialized) voidsetRequestSizeLimit(Integer requestSizeLimit) voidstart()voidstop()Methods inherited from class org.exoplatform.commons.search.index.IndexingOperationProcessor
getConnectors
-
Constructor Details
-
ElasticIndexingOperationProcessor
public ElasticIndexingOperationProcessor(IndexingOperationDAO indexingOperationDAO, ElasticIndexingClient elasticIndexingClient, ElasticContentRequestBuilder elasticContentRequestBuilder, ElasticIndexingAuditTrail auditTrail, org.exoplatform.commons.persistence.impl.EntityManagerService entityManagerService, org.exoplatform.container.xml.InitParams initParams)
-
-
Method Details
-
addConnector
Description copied from class:IndexingOperationProcessorAdd Indexing Connector to the service- Overrides:
addConnectorin classIndexingOperationProcessor- Parameters:
indexingServiceConnector- the indexing connector to add
-
addConnector
Description copied from class:IndexingOperationProcessorAdd Indexing Connector to the service- Overrides:
addConnectorin classIndexingOperationProcessor- Parameters:
indexingServiceConnector- the indexing connector to addoverride- equal true if we can override an existing connector, false otherwise
-
process
public void process()Handle the Indexing queue Get all data in the indexing queue, transform them to ES requests, send requests to ES This method is ONLY called by the job scheduler. This method is not annotated with @ExoTransactional because we don't want it to be executed in one transaction. A request lifecycle is started and ended for all jobs, it is done by org.exoplatform.services.scheduler.impl.JobEnvironmentConfigListener. It means that we have 1 entity manager per job execution. Because of that, we have to take care of cleaning the persistence context regularly to avoid to have too big sessions and bad performances. This method is synchronized to make sure the queue is processed by only one thread at a time, since the indexing queue does not support multi-thread processing for the moment.- Specified by:
processin classIndexingOperationProcessor
-
interrupt
public void interrupt()Set the indexing process as interrupted in order to terminate it as soon as possible without finishing the whole process. Since the indexing process can take time (for a reindexAll operation for example), it allows to interrupt it gracefully (without killing the thread).- Specified by:
interruptin classIndexingOperationProcessor
-
getBatchNumber
-
setBatchNumber
-
getRequestSizeLimit
-
setRequestSizeLimit
-
start
public void start()- Specified by:
startin interfaceorg.picocontainer.Startable
-
stop
public void stop()- Specified by:
stopin interfaceorg.picocontainer.Startable
-
setInitialized
public void setInitialized(boolean initialized)
-