Class SimpleIndexingProgressMonitor

java.lang.Object
org.hibernate.search.impl.SimpleIndexingProgressMonitor
All Implemented Interfaces:
MassIndexerProgressMonitor

public class SimpleIndexingProgressMonitor extends Object implements MassIndexerProgressMonitor
A very simple implementation of MassIndexerProgressMonitor which uses the logger at INFO level to output indexing speed statistics.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Logs progress of indexing job every 50 documents written.
    SimpleIndexingProgressMonitor(int loggingPeriod)
    Logs progress of indexing job every loggingPeriod documents written.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addToTotalCount(long count)
    The total count of entities to be indexed is added here; It could be called more than once, the implementation should add them up.
    void
    documentsAdded(long increment)
    The number of documents sent to the backend; This is invoked several times during the indexing process.
    void
    documentsBuilt(int number)
    The number of Documents built; This is invoked several times and concurrently during the indexing process.
    void
    entitiesLoaded(int size)
    The number of entities loaded from database; This is invoked several times and concurrently during the indexing process.
    protected int
     
    void
    Invoked when the indexing is completed.
    protected void
    printStatusMessage(long starttime, long totalTodoCount, long doneCount)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimpleIndexingProgressMonitor

      public SimpleIndexingProgressMonitor()
      Logs progress of indexing job every 50 documents written.
    • SimpleIndexingProgressMonitor

      public SimpleIndexingProgressMonitor(int loggingPeriod)
      Logs progress of indexing job every loggingPeriod documents written.
      Parameters:
      loggingPeriod - the logging period
  • Method Details

    • entitiesLoaded

      public void entitiesLoaded(int size)
      Description copied from interface: MassIndexerProgressMonitor
      The number of entities loaded from database; This is invoked several times and concurrently during the indexing process.
      Specified by:
      entitiesLoaded in interface MassIndexerProgressMonitor
      Parameters:
      size - number of entities loaded from database
    • documentsAdded

      public void documentsAdded(long increment)
      Description copied from interface: MassIndexerProgressMonitor
      The number of documents sent to the backend; This is invoked several times during the indexing process.
      Specified by:
      documentsAdded in interface MassIndexerProgressMonitor
      Parameters:
      increment - number of documents sent to backend
    • documentsBuilt

      public void documentsBuilt(int number)
      Description copied from interface: MassIndexerProgressMonitor
      The number of Documents built; This is invoked several times and concurrently during the indexing process.
      Specified by:
      documentsBuilt in interface MassIndexerProgressMonitor
      Parameters:
      number - number of Documents built
    • addToTotalCount

      public void addToTotalCount(long count)
      Description copied from interface: MassIndexerProgressMonitor
      The total count of entities to be indexed is added here; It could be called more than once, the implementation should add them up. This is invoked several times and concurrently during the indexing process.
      Specified by:
      addToTotalCount in interface MassIndexerProgressMonitor
      Parameters:
      count - number of newly indexed entities which has to be added to total count
    • indexingCompleted

      public void indexingCompleted()
      Description copied from interface: MassIndexerProgressMonitor
      Invoked when the indexing is completed.
      Specified by:
      indexingCompleted in interface MassIndexerProgressMonitor
    • getStatusMessagePeriod

      protected int getStatusMessagePeriod()
    • printStatusMessage

      protected void printStatusMessage(long starttime, long totalTodoCount, long doneCount)