org.archive.wayback.resourceindex.bdb
Class BDBIndex

java.lang.Object
  extended by org.archive.wayback.util.bdb.BDBRecordSet
      extended by org.archive.wayback.resourceindex.bdb.BDBIndex
All Implemented Interfaces:
SearchResultSource, UpdatableSearchResultSource

public class BDBIndex
extends BDBRecordSet
implements UpdatableSearchResultSource

Version:
$Date: 2010-09-29 05:28:38 +0700 (Wed, 29 Sep 2010) $, $Revision: 3262 $
Author:
brad

Constructor Summary
BDBIndex()
           
 
Method Summary
 void addSearchResults(Iterator<CaptureSearchResult> itr, UrlCanonicalizer canonicalizer)
           
 void cleanup(CloseableIterator<CaptureSearchResult> c)
           
 String getBdbName()
           
 String getBdbPath()
           
 CloseableIterator<CaptureSearchResult> getPrefixIterator(String prefix)
           
 CloseableIterator<CaptureSearchResult> getPrefixReverseIterator(String prefix)
           
 void init()
           
static void main(String[] args)
           
 void setBdbName(String bdbName)
           
 void setBdbPath(String bdbPath)
           
 void shutdown()
           
 
Methods inherited from class org.archive.wayback.util.bdb.BDBRecordSet
bytesToString, delete, get, getDbName, getPath, initializeDB, insertRecords, put, recordIterator, recordIterator, setDbName, setPath, shutdownDB, stringToBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BDBIndex

public BDBIndex()
Method Detail

init

public void init()
          throws IOException,
                 ConfigurationException
Throws:
com.sleepycat.je.DatabaseException
ConfigurationException
IOException

getPrefixIterator

public CloseableIterator<CaptureSearchResult> getPrefixIterator(String prefix)
                                                         throws ResourceIndexNotAvailableException
Specified by:
getPrefixIterator in interface SearchResultSource
Returns:
CleanableIterator that will return SearchResults beginning with prefix argument, with subsequent next() calls returning subsequent results.
Throws:
ResourceIndexNotAvailableException

getPrefixReverseIterator

public CloseableIterator<CaptureSearchResult> getPrefixReverseIterator(String prefix)
                                                                throws ResourceIndexNotAvailableException
Specified by:
getPrefixReverseIterator in interface SearchResultSource
Returns:
CleanableIterator that will return SearchResults starting *before* prefix argument, with subsequent next() calls returning previous results.
Throws:
ResourceIndexNotAvailableException

cleanup

public void cleanup(CloseableIterator<CaptureSearchResult> c)
             throws IOException
Specified by:
cleanup in interface SearchResultSource
Throws:
IOException

addSearchResults

public void addSearchResults(Iterator<CaptureSearchResult> itr,
                             UrlCanonicalizer canonicalizer)
                      throws IOException
Specified by:
addSearchResults in interface UpdatableSearchResultSource
Throws:
IOException

main

public static void main(String[] args)
Parameters:
args -

getBdbPath

public String getBdbPath()
Returns:
the bdbPath

setBdbPath

public void setBdbPath(String bdbPath)
Parameters:
bdbPath - the bdbPath to set

getBdbName

public String getBdbName()
Returns:
the bdbName

setBdbName

public void setBdbName(String bdbName)
Parameters:
bdbName - the bdbName to set

shutdown

public void shutdown()
              throws IOException
Specified by:
shutdown in interface SearchResultSource
Throws:
IOException


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