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
  • Constructor Details

  • Method Details

    • addConnector

      public void addConnector(IndexingServiceConnector indexingServiceConnector)
      Description copied from class: IndexingOperationProcessor
      Add Indexing Connector to the service
      Overrides:
      addConnector in class IndexingOperationProcessor
      Parameters:
      indexingServiceConnector - the indexing connector to add
    • addConnector

      public void addConnector(IndexingServiceConnector indexingServiceConnector, Boolean override)
      Description copied from class: IndexingOperationProcessor
      Add Indexing Connector to the service
      Overrides:
      addConnector in class IndexingOperationProcessor
      Parameters:
      indexingServiceConnector - the indexing connector to add
      override - 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:
      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)