Interface SolrIndexOperation

All Known Implementing Classes:
GlobalSolrFullReIndexOperation

public interface SolrIndexOperation
Defines the lifecylce of an indexing operation used in SolrIndexService. Each of the methods in this interface are executed in order during different phases of SolrIndexService.executeSolrIndexOperation(SolrIndexOperation).
Author:
Phillip Verheyden (phillipuniverse)
  • Method Details

    • obtainLock

      boolean obtainLock()
      Grab some sort of lock so that nothing else can index items at the same time
    • getSolrServerForIndexing

      org.apache.solr.client.solrj.SolrClient getSolrServerForIndexing()
      Which SolrClient the index should be built on
    • getSolrCollectionForIndexing

      String getSolrCollectionForIndexing()
      Which collection the index should be built on
    • beforeCountIndexables

      void beforeCountIndexables()
      Executes before the count, this is where any filters or setup for counting can be taken care of
    • countIndexables

      Long countIndexables() throws org.broadleafcommerce.common.exception.ServiceException
      The count of all of the Indexable items about to be indexed. Used to determine paging used by #readIndexables(int, int)
      Throws:
      org.broadleafcommerce.common.exception.ServiceException
    • afterCountIndexables

      void afterCountIndexables()
      Executes after the count, this is where any filters or cleanup for counting can be taken care of
    • beforeReadIndexables

      void beforeReadIndexables()
      Executes before the read, this is where any filters or setup for reading can be taken care of
    • readIndexables

      List<? extends Indexable> readIndexables(int pageSize, Long lastId) throws org.broadleafcommerce.common.exception.ServiceException
      Perform the a read of the Indexable items for a particular page and pageSize
      Throws:
      org.broadleafcommerce.common.exception.ServiceException
    • afterReadIndexables

      void afterReadIndexables()
      Executes after the read, this is where any filters or cleanup for reading can be taken care of
    • beforeBuildPage

      void beforeBuildPage()
      Executes before building each page, this is where any filters or setup for building can be taken care of
    • buildPage

      void buildPage(List<? extends Indexable> indexables) throws org.broadleafcommerce.common.exception.ServiceException
      Throws:
      org.broadleafcommerce.common.exception.ServiceException
    • afterBuildPage

      void afterBuildPage()
      Executes after building each page, this is where any filters or cleanup for building can be taken care of
    • releaseLock

      void releaseLock()
      If a lock was obtained in obtainLock() this releases it