Class PojoMassIndexingLoggingMonitor
- All Implemented Interfaces:
MassIndexingMonitor
MassIndexerProgressMonitor which
uses the logger at INFO level to output indexing speed statistics.- Author:
- Sanne Grinovero
-
Constructor Summary
ConstructorsConstructorDescriptionLogs progress of indexing job every 50 documents written.PojoMassIndexingLoggingMonitor(int logAfterNumberOfDocuments) Logs progress of indexing job everylogAfterNumberOfDocumentsdocuments written. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToTotalCount(long count) Notify the monitor thatincrementmore entities have been detected in the database and will be indexed.voiddocumentsAdded(long increment) Notify the monitor thatincrementmore documents have been added to the index.voiddocumentsBuilt(long number) Notify the monitor thatincrementmore documents have been built.voidentitiesLoaded(long size) Notify the monitor thatincrementmore entities have been loaded from the database.protected intvoidNotify the monitor that indexing is complete.protected voidprintStatusMessage(long startTime, long currentTime, long totalTodoCount, long doneCount)
-
Constructor Details
-
PojoMassIndexingLoggingMonitor
public PojoMassIndexingLoggingMonitor()Logs progress of indexing job every 50 documents written. -
PojoMassIndexingLoggingMonitor
public PojoMassIndexingLoggingMonitor(int logAfterNumberOfDocuments) Logs progress of indexing job everylogAfterNumberOfDocumentsdocuments written.- Parameters:
logAfterNumberOfDocuments- log each time the specified number of documents has been added
-
-
Method Details
-
documentsAdded
public void documentsAdded(long increment) Description copied from interface:MassIndexingMonitorNotify the monitor thatincrementmore documents have been added to the index.Summing the numbers passed to this method gives the total number of documents that have been added to the index so far.
This method is invoked several times during indexing, and calls are incremental: calling
documentsAdded(3)and thendocumentsAdded(1)should be understood as "3+1 documents, i.e. 4 documents have been added to the index".This method can be invoked from several threads thus implementors are required to be thread-safe.
- Specified by:
documentsAddedin interfaceMassIndexingMonitor- Parameters:
increment- additional number of documents built
-
documentsBuilt
public void documentsBuilt(long number) Description copied from interface:MassIndexingMonitorNotify the monitor thatincrementmore documents have been built.Summing the numbers passed to this method gives the total number of documents that have been built so far.
This method is invoked several times during indexing, and calls are incremental: calling
documentsBuilt(3)and thendocumentsBuilt(1)should be understood as "3+1 documents, i.e. 4 documents have been built".This method can be invoked from several threads thus implementors are required to be thread-safe.
- Specified by:
documentsBuiltin interfaceMassIndexingMonitor- Parameters:
number- additional number of documents built
-
entitiesLoaded
public void entitiesLoaded(long size) Description copied from interface:MassIndexingMonitorNotify the monitor thatincrementmore entities have been loaded from the database.Summing the numbers passed to this method gives the total number of entities that have been loaded so far.
This method is invoked several times during indexing, and calls are incremental: calling
entitiesLoaded(3)and thenentitiesLoaded(1)should be understood as "3+1 documents, i.e. 4 documents have been loaded".This method can be invoked from several threads thus implementors are required to be thread-safe.
- Specified by:
entitiesLoadedin interfaceMassIndexingMonitor- Parameters:
size- additional number of entities loaded from database
-
addToTotalCount
public void addToTotalCount(long count) Description copied from interface:MassIndexingMonitorNotify the monitor thatincrementmore entities have been detected in the database and will be indexed.Summing the numbers passed to this method gives the total number of entities that Hibernate Search plans to index. This number can be incremented during indexing as Hibernate Search moves from one entity type to the next.
This method is invoked several times during indexing, and calls are incremental: calling
addToTotalCount(3)and thenaddToTotalCount(1)should be understood as "3+1 documents, i.e. 4 documents will be indexed".This method can be invoked from several threads thus implementors are required to be thread-safe.
- Specified by:
addToTotalCountin interfaceMassIndexingMonitor- Parameters:
count- additional number of entities that will be indexed
-
indexingCompleted
public void indexingCompleted()Description copied from interface:MassIndexingMonitorNotify the monitor that indexing is complete.- Specified by:
indexingCompletedin interfaceMassIndexingMonitor
-
getStatusMessagePeriod
protected int getStatusMessagePeriod() -
printStatusMessage
protected void printStatusMessage(long startTime, long currentTime, long totalTodoCount, long doneCount)
-