org.hibernate.search.batchindexing.impl

## Class SimpleIndexingProgressMonitor

- java.lang.Object
- - org.hibernate.search.batchindexing.impl.SimpleIndexingProgressMonitor

- All Implemented Interfaces:
    IndexingMonitor, 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.
  Author:
    Sanne Grinovero

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleIndexingProgressMonitor()` Logs progress of indexing job every 50 documents written.
    `SimpleIndexingProgressMonitor(int logAfterNumberOfDocuments)` Logs progress of indexing job every `logAfterNumberOfDocuments` documents written.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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)` Notify the IndexingMonitor of the number of documents added to the index.
    `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` | `getStatusMessagePeriod()`
    `void` | `indexingCompleted()` 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 Detail

    - #### SimpleIndexingProgressMonitor

          public SimpleIndexingProgressMonitor()

      Logs progress of indexing job every 50 documents written.

    - #### SimpleIndexingProgressMonitor

          public SimpleIndexingProgressMonitor(int logAfterNumberOfDocuments)

      Logs progress of indexing job every `logAfterNumberOfDocuments` documents written.
      Parameters:
        `logAfterNumberOfDocuments` - log each time the specified number of documents has been added

  - ### Method Detail

    - #### 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: `IndexingMonitor`
      Notify the IndexingMonitor of the number of documents added to the index. This can be invoked several times during the indexing process, and could be invoked concurrently by different threads.
      Specified by:
        `documentsAdded` in interface `IndexingMonitor`
      Parameters:
        `increment` - number of documents add operations performed

    - #### 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 `Document`s 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)

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved