|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.archive.crawler.frontier.AdaptiveRevisitQueueList
public class AdaptiveRevisitQueueList
Maintains an ordered list of AdaptiveRevisitHostQueue
s used by a
Frontier.
The list is ordered by the
AdaptiveRevisitHostQueue.getNextReadyTime()
,
smallest value at the top of the list and then on in descending order.
The list will maintain a list of hostnames in a seperate DB. On creation a list will try to open the DB at a specified location. If it already exists the list will create HQs for all the hostnames in the list, discarding those that turn out to be empty.
Any BDB DatabaseException will be converted to an IOException by public methods. This includes preserving the original stacktrace, in favor of the one created for the IOException, so that the true source of the exception is not lost.
Constructor Summary | |
---|---|
AdaptiveRevisitQueueList(com.sleepycat.je.Environment env,
com.sleepycat.bind.serial.StoredClassCatalog catalog)
|
Method Summary | |
---|---|
void |
close()
Closes all HQs and the Environment. |
AdaptiveRevisitHostQueue |
createHQ(java.lang.String hostName,
int valence)
Creates a new AdaptiveRevisitHostQueue. |
long |
getAverageDepth()
Returns the average depth of all the HQs in this list |
float |
getCongestionRatio()
Returns the congestion ratio. |
long |
getDeepestQueueSize()
Returns the size of the largest (deepest) queue. |
AdaptiveRevisitHostQueue |
getHQ(java.lang.String hostName)
Get an AdaptiveRevisitHostQueue for the specified host. |
java.lang.String[] |
getReports()
Get an array of report names offered by this Reporter. |
long |
getSize()
Returns the number of URIs in all the HQs in this list |
AdaptiveRevisitHostQueue |
getTopHQ()
|
long |
getUriCount()
The total number of URIs queued in all the HQs belonging to this list. |
protected void |
reorder(AdaptiveRevisitHostQueue hq)
This method reorders the host queues. |
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. |
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 writer)
Make a single-line summary report to the passed-in writer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AdaptiveRevisitQueueList(com.sleepycat.je.Environment env, com.sleepycat.bind.serial.StoredClassCatalog catalog) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public AdaptiveRevisitHostQueue getHQ(java.lang.String hostName)
If one does not already exist, null is returned
hostName
- The host's name
public AdaptiveRevisitHostQueue createHQ(java.lang.String hostName, int valence) throws java.io.IOException
If a HQ already existed for the specified hostName, the existing HQ is returned as it is. It's existing valence will not be updated to reflect a different valence.
hostName
- valence
- number of simultaneous connections allowed to this host
java.io.IOException
public AdaptiveRevisitHostQueue getTopHQ()
public long getSize()
public long getAverageDepth()
public long getDeepestQueueSize()
public float getCongestionRatio()
The congestion ratio is equal to the total number of queues divided by the number of queues currently being processed or are snozzed (i.e. not ready). A congestion ratio of 1 indicates no congestion.
protected void reorder(AdaptiveRevisitHostQueue hq)
hq
- The calling HQpublic long getUriCount()
public void close()
public java.lang.String[] getReports()
Reporter
getReports
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 reportpublic void reportTo(java.lang.String name, java.io.PrintWriter writer)
Reporter
reportTo
in interface Reporter
writer
- to receive reportpublic void singleLineReportTo(java.io.PrintWriter writer)
Reporter
singleLineReportTo
in interface Reporter
writer
- to receive reportpublic java.lang.String singleLineLegend()
Reporter
singleLineLegend
in interface Reporter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |