Class ReindexStateHolder
java.lang.Object
org.broadleafcommerce.core.search.service.solr.indexer.ReindexStateHolder
Holder to contain cross-thread state during Solr reindexing.
- Author:
- Kelly Tisdell
-
Method Summary
Modifier and TypeMethodDescriptionvoidlongstatic ReindexStateHoldergetInstance(String collectionName) Returns a shared instance of this class or null.static ReindexStateHoldergetInstance(String collectionName, boolean incrementalCommits, boolean createIfAbsent) Creates or returns a shared instance of this class associated with the collectionName.longlonglongincrementIndexableCount(long delta) longincrementUnindexedItemCount(long delta) booleanisFailed()booleanvoidsetLastCommitted(long lastCommitted) static voidunregister(String collectionName)
-
Method Details
-
getInstance
Returns a shared instance of this class or null.This method will typically be used by background worker threads that will use an instance that has already been created. This may return null if an instance has not yet been created by the control thread or the control thread has already deregistered the instance by calling deregister.
- Parameters:
collectionName-- Returns:
-
getInstance
public static ReindexStateHolder getInstance(String collectionName, boolean incrementalCommits, boolean createIfAbsent) Creates or returns a shared instance of this class associated with the collectionName. If createIfAbsent is set to false, this will return null if an instance has not been created. The argument for incrementalCommits is a hint indicating that commits may be issued during a reindex process. This argument is ignored if an instance has already been created.This method will typically be used by a control thread that will create a new instance for a process that may be multi-threaded.
- Parameters:
collectionName-incrementalCommits-createIfAbsent-- Returns:
-
unregister
-
getCollectionName
-
isIncrementalCommits
public boolean isIncrementalCommits() -
isFailed
public boolean isFailed() -
failFast
-
getFailure
-
getIndexableCount
public long getIndexableCount() -
incrementIndexableCount
public long incrementIndexableCount(long delta) -
getUnindexedItemCount
public long getUnindexedItemCount() -
incrementUnindexedItemCount
public long incrementUnindexedItemCount(long delta) -
getAdditionalState
-
getLastCommitted
public long getLastCommitted() -
setLastCommitted
public void setLastCommitted(long lastCommitted)
-