Package org.opencms.search
Class CmsIndexingThreadManager
java.lang.Object
org.opencms.search.CmsIndexingThreadManager
Implements the management of indexing threads.
- Since:
- 6.0.0
-
Constructor Summary
ConstructorDescriptionCmsIndexingThreadManager
(long timeout, int maxModificationsBeforeCommit) Creates and starts a thread manager for indexing threads. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createIndexingThread
(CmsVfsIndexer indexer, I_CmsIndexWriter writer, CmsResource res) Creates and starts a new indexing thread for a resource.boolean
Returns if the indexing manager still have indexing threads.void
reportStatistics
(I_CmsReport report) Writes statistical information to the report.
-
Constructor Details
-
CmsIndexingThreadManager
Creates and starts a thread manager for indexing threads.- Parameters:
timeout
- timeout after a thread is abandonedmaxModificationsBeforeCommit
- the maximum number of modifications before a commit in the search index is triggered
-
-
Method Details
-
createIndexingThread
Creates and starts a new indexing thread for a resource.After an indexing thread was started, the manager suspends itself and waits for an amount of time specified by the
timeout
value. If the timeout value is reached, the indexing thread is aborted by an interrupt signal.- Parameters:
indexer
- the VFS indexer to create the index thread forwriter
- the index writer that can update the indexres
- the resource
-
isRunning
Returns if the indexing manager still have indexing threads.- Returns:
- true if the indexing manager still have indexing threads
-
reportStatistics
Writes statistical information to the report.The method reports the total number of threads started (equals to the number of indexed files), the number of returned threads (equals to the number of successfully indexed files), and the number of abandoned threads (hanging threads reaching the timeout).
- Parameters:
report
- the report to write the statistics to
-