|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ThreadGroup org.archive.crawler.framework.ToePool
public class ToePool
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.
ToeThread
Field Summary | |
---|---|
static java.lang.String |
COMPACT_REPORT
|
protected CrawlController |
controller
|
static int |
DEFAULT_TOE_PRIORITY
run worker thread slightly lower than usual |
protected int |
nextSerialNumber
|
protected static java.lang.String[] |
REPORTS
|
static java.lang.String |
STANDARD_REPORT
|
protected int |
targetSize
|
Constructor Summary | |
---|---|
ToePool(CrawlController c)
Constructor. |
Method Summary | |
---|---|
void |
cleanup()
|
protected void |
compactReportTo(java.io.PrintWriter writer)
|
int |
getActiveToeCount()
|
CrawlController |
getController()
|
java.lang.String[] |
getReports()
Get an array of report names offered by this Reporter. |
int |
getToeCount()
|
void |
killThread(int threadNumber,
boolean replace)
Kills specified thread. |
void |
reportTo(java.io.PrintWriter writer)
Make a default report to the passed-in Writer. |
void |
reportTo(java.lang.String name,
java.io.PrintWriter writer)
Make a report of the given name to the passed-in Writer, If null, give the default report. |
void |
setSize(int newsize)
Change the number of ToeThreads. |
java.lang.String |
singleLineLegend()
Return a legend for the single-line summary report as a String. |
java.lang.String |
singleLineReport()
Return a short single-line summary report as a String. |
void |
singleLineReportTo(java.io.PrintWriter w)
Make a single-line summary report to the passed-in writer |
protected void |
standardReportTo(java.io.PrintWriter writer)
|
Methods inherited from class java.lang.ThreadGroup |
---|
activeCount, activeGroupCount, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, parentOf, resume, setDaemon, setMaxPriority, stop, suspend, toString, uncaughtException |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static int DEFAULT_TOE_PRIORITY
protected CrawlController controller
protected int nextSerialNumber
protected int targetSize
public static java.lang.String STANDARD_REPORT
public static java.lang.String COMPACT_REPORT
protected static java.lang.String[] REPORTS
Constructor Detail |
---|
public ToePool(CrawlController c)
c
- A reference to the CrawlController for the current crawl.Method Detail |
---|
public void cleanup()
public int getActiveToeCount()
public int getToeCount()
public void setSize(int newsize)
newsize
- The new number of ToeThreads.public void killThread(int threadNumber, boolean replace)
WARNING: This operation should be used with great care. It may destabilize the crawler.
threadNumber
- Thread to killreplace
- If true then a new thread will be created to take the
killed threads place. Otherwise the total number of threads
will decrease by one.public CrawlController getController()
public java.lang.String[] getReports()
Reporter
getReports
in interface Reporter
public void reportTo(java.lang.String name, java.io.PrintWriter writer)
Reporter
reportTo
in interface Reporter
writer
- to receive reportprotected void standardReportTo(java.io.PrintWriter writer)
protected void compactReportTo(java.io.PrintWriter writer)
public void singleLineReportTo(java.io.PrintWriter w)
Reporter
singleLineReportTo
in interface Reporter
w
- to receive reportpublic java.lang.String singleLineLegend()
Reporter
singleLineLegend
in interface Reporter
public java.lang.String singleLineReport()
Reporter
singleLineReport
in interface Reporter
public void reportTo(java.io.PrintWriter writer)
Reporter
reportTo
in interface Reporter
writer
- to receive report
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |