|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.search.CmsIndexingThreadManager
public class CmsIndexingThreadManager
Implements the management of indexing threads.
Constructor Summary | |
---|---|
CmsIndexingThreadManager(long timeout,
int maxModificationsBeforeCommit)
Creates and starts a thread manager for indexing threads. |
Method Summary | |
---|---|
void |
createIndexingThread(CmsObject cms,
org.apache.lucene.index.IndexWriter writer,
CmsResource res,
CmsSearchIndex index,
I_CmsReport report)
Creates and starts a new indexing thread for a resource. |
int |
getCounter()
Gets the current thread (file) count. |
boolean |
isRunning()
Returns if the indexing manager still have indexing threads. |
void |
reportStatistics(I_CmsReport report)
Writes statistical information to the report. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CmsIndexingThreadManager(long timeout, int maxModificationsBeforeCommit)
timeout
- timeout after a thread is abandonedmaxModificationsBeforeCommit
- the maximum number of modifications before a commit in the search index is triggeredMethod Detail |
---|
public void createIndexingThread(CmsObject cms, org.apache.lucene.index.IndexWriter writer, CmsResource res, CmsSearchIndex index, I_CmsReport report)
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.
cms
- the cms objectwriter
- the write to write the indexres
- the resourceindex
- the indexreport
- the report to write the indexing progress topublic int getCounter()
public boolean isRunning()
public void reportStatistics(I_CmsReport 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).
report
- the report to write the statistics topublic void run()
The thread manager looks all 10 minutes if threads are not returned and reports the number to the log file.
Runnable.run()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |