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 Summary
Modifier and TypeMethodDescriptionvoidExecutes after building each page, this is where any filters or cleanup for building can be taken care ofvoidExecutes after the count, this is where any filters or cleanup for counting can be taken care ofvoidExecutes after the read, this is where any filters or cleanup for reading can be taken care ofvoidExecutes before building each page, this is where any filters or setup for building can be taken care ofvoidExecutes before the count, this is where any filters or setup for counting can be taken care ofvoidExecutes before the read, this is where any filters or setup for reading can be taken care ofvoidBuild a page fromreadIndexables(int, Long)on thegetSolrServerForIndexing().The count of all of theIndexableitems about to be indexed.Which collection the index should be built onorg.apache.solr.client.solrj.SolrClientWhichSolrClientthe index should be built onbooleanGrab some sort of lock so that nothing else can index items at the same timereadIndexables(int pageSize, Long lastId) Perform the a read of theIndexableitems for a particular page and pageSizevoidIf a lock was obtained inobtainLock()this releases it
-
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()WhichSolrClientthe 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
The count of all of theIndexableitems 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 theIndexableitems 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 Build a page fromreadIndexables(int, Long)on thegetSolrServerForIndexing(). This is used as a wrapper extension aroundSolrIndexService.buildIncrementalIndex(String, List, SolrClient).- 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 inobtainLock()this releases it
-