| |
|
| java.lang.Object java.lang.ThreadGroup org.archive.crawler.framework.ToePool
ToePool | public class ToePool extends ThreadGroup implements Reporter(Code) | | A collection of ToeThreads. The class manages the ToeThreads currently
running. Including increasing and decreasing their number, keeping track
of their state and it can be used to kill hung threads.
author: Gordon Mohr author: Kristinn Sigurdsson See Also: org.archive.crawler.framework.ToeThread |
DEFAULT_TOE_PRIORITY | public static int DEFAULT_TOE_PRIORITY(Code) | | run worker thread slightly lower than usual
|
nextSerialNumber | protected int nextSerialNumber(Code) | | |
targetSize | protected int targetSize(Code) | | |
ToePool | public ToePool(CrawlController c)(Code) | | Constructor. Creates a pool of ToeThreads.
Parameters: c - A reference to the CrawlController for the current crawl. |
cleanup | public void cleanup()(Code) | | |
getActiveToeCount | public int getActiveToeCount()(Code) | | The number of ToeThreads that are not available (Approximation). |
getToeCount | public int getToeCount()(Code) | | The number of ToeThreads. This may include killed ToeThreadsthat were not replaced. |
killThread | public void killThread(int threadNumber, boolean replace)(Code) | | Kills specified thread. Killed thread can be optionally replaced with a
new thread.
WARNING: This operation should be used with great care. It may
destabilize the crawler.
Parameters: threadNumber - Thread to kill Parameters: replace - If true then a new thread will be created to take thekilled threads place. Otherwise the total number of threadswill decrease by one. |
setSize | public void setSize(int newsize)(Code) | | Change the number of ToeThreads.
Parameters: newsize - The new number of ToeThreads. |
|
|
|