org.archive.crawler.frontier
Class BdbMultipleWorkQueues.BdbFrontierMarker

java.lang.Object
  extended by org.archive.crawler.frontier.BdbMultipleWorkQueues.BdbFrontierMarker
All Implemented Interfaces:
FrontierMarker
Enclosing class:
BdbMultipleWorkQueues

public class BdbMultipleWorkQueues.BdbFrontierMarker
extends java.lang.Object
implements FrontierMarker

Marker for remembering a position within the BdbMultipleWorkQueues.

Author:
gojomo

Field Summary
(package private)  int nextItemNumber
           
(package private)  java.util.regex.Pattern pattern
           
(package private)  com.sleepycat.je.DatabaseEntry startKey
           
 
Constructor Summary
BdbMultipleWorkQueues.BdbFrontierMarker(com.sleepycat.je.DatabaseEntry startKey, java.lang.String regexpr)
          Create a marker pointed at the given start location.
 
Method Summary
 boolean accepts(CrawlURI curi)
           
 java.lang.String getMatchExpression()
          Returns the regular expression that this marker uses.
 long getNextItemNumber()
          Returns the number of the next match after the marker.
 com.sleepycat.je.DatabaseEntry getStartKey()
           
 boolean hasNext()
          Returns false if no more URIs can be found matching the expression beyond those already covered.
 void setStartKey(com.sleepycat.je.DatabaseEntry key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startKey

com.sleepycat.je.DatabaseEntry startKey

pattern

java.util.regex.Pattern pattern

nextItemNumber

int nextItemNumber
Constructor Detail

BdbMultipleWorkQueues.BdbFrontierMarker

public BdbMultipleWorkQueues.BdbFrontierMarker(com.sleepycat.je.DatabaseEntry startKey,
                                               java.lang.String regexpr)
Create a marker pointed at the given start location.

Parameters:
startKey -
regexpr -
Method Detail

accepts

public boolean accepts(CrawlURI curi)
Parameters:
curi -
Returns:
whether the marker accepts the given CrawlURI

setStartKey

public void setStartKey(com.sleepycat.je.DatabaseEntry key)
Parameters:
key - position for marker

getStartKey

public com.sleepycat.je.DatabaseEntry getStartKey()
Returns:
startKey

getMatchExpression

public java.lang.String getMatchExpression()
Description copied from interface: FrontierMarker
Returns the regular expression that this marker uses.

Specified by:
getMatchExpression in interface FrontierMarker
Returns:
the regular expression that this marker uses

getNextItemNumber

public long getNextItemNumber()
Description copied from interface: FrontierMarker
Returns the number of the next match after the marker. Alternatively this can be viewed as n-1, where n is the number of items found before the marker.

Specified by:
getNextItemNumber in interface FrontierMarker
Returns:
the number of the next match after the marker

hasNext

public boolean hasNext()
Description copied from interface: FrontierMarker
Returns false if no more URIs can be found matching the expression beyond those already covered. True otherwise.

Specified by:
hasNext in interface FrontierMarker
Returns:
Are there any more matches.


Copyright © 2003-2011 Internet Archive. All Rights Reserved.