dk.netarkivet.harvester.harvesting.frontier
Class FrontierReportLine

java.lang.Object
  extended by dk.netarkivet.harvester.harvesting.frontier.FrontierReportLine
All Implemented Interfaces:
FrontierReportLineOrderKey, java.io.Serializable, java.lang.Comparable<FrontierReportLine>
Direct Known Subclasses:
FullFrontierReport.PersistentLine

@Persistent
public class FrontierReportLine
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<FrontierReportLine>, FrontierReportLineOrderKey

Wraps a line of the frontier report. As of Heritrix 1.14.14, the format of a frontier report line sequentially lists the following tokens, separated by a whitespace :

  1. queue
  2. currentSize
  3. totalEnqueues
  4. sessionBalance
  5. lastCost(averageCost)
  6. lastDequeueTime
  7. wakeTime
  8. totalSpend/totalBudget
  9. errorCount
  10. lastPeekUri
  11. lastQueuedUri
This class implements a natural order : comparisons are made : - first by decreasing values of totalEnqueues - secondly by domain name (string natural order) Thanks to Gordon Mohr at Internet Archive for explaining the exact semantics of the frontier report fields.

See Also:
Serialized Form

Field Summary
(package private) static java.lang.String EMPTY_VALUE_TOKEN
          Token used to signify an empty value.
 
Constructor Summary
  FrontierReportLine()
          Default empty constructor.
protected FrontierReportLine(FrontierReportLine original)
          Builds a cloned line.
(package private) FrontierReportLine(java.lang.String lineToken)
          Parses the given string.
 
Method Summary
 int compareTo(FrontierReportLine l)
          Default order relation is descending size of the queue (totalEnqueues).
 boolean equals(java.lang.Object obj)
          There is one queue per domain, so equality is based on the domain name.
 double getAverageCost()
           
 long getCurrentSize()
           
 java.lang.String getDomainName()
           
 long getErrorCount()
           
 double getLastCost()
           
 java.lang.String getLastDequeueTime()
           
 java.lang.String getLastPeekUri()
           
 java.lang.String getLastQueuedUri()
           
 java.lang.String getQueueId()
          Returns the queue's unique identifier.
 long getQueueSize()
          Returns the queue size.
 long getSessionBalance()
           
 long getTotalBudget()
           
 long getTotalEnqueues()
           
 long getTotalSpend()
           
 java.lang.String getWakeTime()
           
 int hashCode()
          There is one queue per domain, so hashcode is based on the domain name.
 void setAverageCost(double averageCost)
           
 void setCurrentSize(long currentSize)
           
 void setDomainName(java.lang.String domainName)
           
 void setErrorCount(long errorCount)
           
 void setLastCost(double lastCost)
           
 void setLastDequeueTime(java.lang.String lastDequeueTime)
           
 void setLastPeekUri(java.lang.String lastPeekUri)
           
 void setLastQueuedUri(java.lang.String lastQueuedUri)
           
 void setSessionBalance(long sessionBalance)
           
 void setTotalBudget(long totalBudget)
           
 void setTotalEnqueues(long totalEnqueues)
           
 void setTotalSpend(long totalSpend)
           
 void setWakeTime(java.lang.String wakeTime)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_VALUE_TOKEN

static final java.lang.String EMPTY_VALUE_TOKEN
Token used to signify an empty value.

See Also:
Constant Field Values
Constructor Detail

FrontierReportLine

public FrontierReportLine()
Default empty constructor.


FrontierReportLine

protected FrontierReportLine(FrontierReportLine original)
Builds a cloned line.

Parameters:
original - the line to clone

FrontierReportLine

FrontierReportLine(java.lang.String lineToken)
Parses the given string.

Parameters:
lineToken - the string to parse.
Method Detail

getDomainName

public java.lang.String getDomainName()
Returns:
the domainName

setDomainName

public void setDomainName(java.lang.String domainName)
Parameters:
domainName - the domainName to set

getCurrentSize

public long getCurrentSize()
Returns:
the currentSize

setCurrentSize

public void setCurrentSize(long currentSize)
Parameters:
currentSize - the currentSize to set

getTotalEnqueues

public long getTotalEnqueues()
Returns:
the totalEnqueues

setTotalEnqueues

public void setTotalEnqueues(long totalEnqueues)
Parameters:
totalEnqueues - the totalEnqueues to set

getSessionBalance

public long getSessionBalance()
Returns:
the sessionBalance

setSessionBalance

public void setSessionBalance(long sessionBalance)
Parameters:
sessionBalance - the sessionBalance to set

getLastCost

public double getLastCost()
Returns:
the lastCost

setLastCost

public void setLastCost(double lastCost)
Parameters:
lastCost - the lastCost to set

getAverageCost

public double getAverageCost()
Returns:
the averageCost

setAverageCost

public void setAverageCost(double averageCost)
Parameters:
averageCost - the averageCost to set

getLastDequeueTime

public java.lang.String getLastDequeueTime()
Returns:
the lastDequeueTime

setLastDequeueTime

public void setLastDequeueTime(java.lang.String lastDequeueTime)
Parameters:
lastDequeueTime - the lastDequeueTime to set

getWakeTime

public java.lang.String getWakeTime()
Returns:
the wakeTime

setWakeTime

public void setWakeTime(java.lang.String wakeTime)
Parameters:
wakeTime - the wakeTime to set

getTotalSpend

public long getTotalSpend()
Returns:
the totalSpend

setTotalSpend

public void setTotalSpend(long totalSpend)
Parameters:
totalSpend - the totalSpend to set

getTotalBudget

public long getTotalBudget()
Returns:
the totalBudget

setTotalBudget

public void setTotalBudget(long totalBudget)
Parameters:
totalBudget - the totalBudget to set

getErrorCount

public long getErrorCount()
Returns:
the errorCount

setErrorCount

public void setErrorCount(long errorCount)
Parameters:
errorCount - the errorCount to set

getLastPeekUri

public java.lang.String getLastPeekUri()
Returns:
the lastPeekUri

setLastPeekUri

public void setLastPeekUri(java.lang.String lastPeekUri)
Parameters:
lastPeekUri - the lastPeekUri to set

getLastQueuedUri

public java.lang.String getLastQueuedUri()
Returns:
the lastQueuedUri

setLastQueuedUri

public void setLastQueuedUri(java.lang.String lastQueuedUri)
Parameters:
lastQueuedUri - the lastQueuedUri to set

compareTo

public int compareTo(FrontierReportLine l)
Default order relation is descending size of the queue (totalEnqueues).

Specified by:
compareTo in interface java.lang.Comparable<FrontierReportLine>

equals

public boolean equals(java.lang.Object obj)
There is one queue per domain, so equality is based on the domain name.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
There is one queue per domain, so hashcode is based on the domain name.

Overrides:
hashCode in class java.lang.Object

getQueueId

public java.lang.String getQueueId()
Description copied from interface: FrontierReportLineOrderKey
Returns the queue's unique identifier.

Specified by:
getQueueId in interface FrontierReportLineOrderKey
Returns:
the queue's unique identifier.

getQueueSize

public long getQueueSize()
Description copied from interface: FrontierReportLineOrderKey
Returns the queue size.

Specified by:
getQueueSize in interface FrontierReportLineOrderKey
Returns:
the queue size.