| java.lang.Object org.opencms.search.CmsIndexingThreadManager
CmsIndexingThreadManager | public class CmsIndexingThreadManager (Code) | | Implements the management of indexing threads.
author: Carsten Weinholz author: Alexander Kandzior version: $Revision: 1.30 $ since: 6.0.0 |
Method Summary | |
public void | createIndexingThread(CmsObject cms, IndexWriter writer, CmsResource res, CmsSearchIndex index, I_CmsReport report) 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. | public int | getCounter() | public boolean | isRunning() | public void | reportStatistics(I_CmsReport report) 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). | public void | run() Starts the thread manager to look for non-terminated threads
The thread manager looks all 10 minutes if threads are not returned
and reports the number to the log file. |
CmsIndexingThreadManager | public CmsIndexingThreadManager(long timeout)(Code) | | Creates and starts a thread manager for indexing threads.
Parameters: timeout - timeout after a thread is abandoned |
createIndexingThread | public void createIndexingThread(CmsObject cms, IndexWriter writer, CmsResource res, CmsSearchIndex index, I_CmsReport report)(Code) | | 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: cms - the cms object Parameters: writer - the write to write the index Parameters: res - the resource Parameters: index - the index Parameters: report - the report to write the indexing progress to |
getCounter | public int getCounter()(Code) | | Gets the current thread (file) count.
the current thread count |
isRunning | public boolean isRunning()(Code) | | Returns if the indexing manager still have indexing threads.
true if the indexing manager still have indexing threads |
reportStatistics | public void reportStatistics(I_CmsReport report)(Code) | | 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 |
run | public void run()(Code) | | Starts the thread manager to look for non-terminated threads
The thread manager looks all 10 minutes if threads are not returned
and reports the number to the log file.
See Also: java.lang.Runnable.run |
|
|