Class ReindexStateHolder

java.lang.Object
org.broadleafcommerce.core.search.service.solr.indexer.ReindexStateHolder

public class ReindexStateHolder extends Object
Holder to contain cross-thread state during Solr reindexing.
Author:
Kelly Tisdell
  • Method Details

    • getInstance

      public static ReindexStateHolder getInstance(String collectionName)
      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

      public static void unregister(String collectionName)
    • getCollectionName

      public String getCollectionName()
    • isIncrementalCommits

      public boolean isIncrementalCommits()
    • isFailed

      public boolean isFailed()
    • failFast

      public void failFast(Exception t)
    • getFailure

      public Exception getFailure()
    • getIndexableCount

      public long getIndexableCount()
    • incrementIndexableCount

      public long incrementIndexableCount(long delta)
    • getUnindexedItemCount

      public long getUnindexedItemCount()
    • incrementUnindexedItemCount

      public long incrementUnindexedItemCount(long delta)
    • getAdditionalState

      public Map<String,Object> getAdditionalState()
    • getLastCommitted

      public long getLastCommitted()
    • setLastCommitted

      public void setLastCommitted(long lastCommitted)