Class ElasticIndexingOperationProcessor

  • All Implemented Interfaces:
    org.picocontainer.Startable

    public class ElasticIndexingOperationProcessor
    extends IndexingOperationProcessor
    implements org.picocontainer.Startable
    Created by The eXo Platform SAS Author : Thibault Clement tclement@exoplatform.com 10/12/15
    • Method Detail

      • 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:
        process in class IndexingOperationProcessor
      • 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:
        interrupt in class IndexingOperationProcessor
      • getBatchNumber

        public Integer getBatchNumber()
      • setBatchNumber

        public void setBatchNumber​(Integer batchNumber)
      • getRequestSizeLimit

        public Integer getRequestSizeLimit()
      • setRequestSizeLimit

        public void setRequestSizeLimit​(Integer requestSizeLimit)
      • start

        public void start()
        Specified by:
        start in interface org.picocontainer.Startable
      • stop

        public void stop()
        Specified by:
        stop in interface org.picocontainer.Startable
      • setInitialized

        public void setInitialized​(boolean initialized)