|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.nutch.db.WebDBWriter
This is a wrapper class that allows us to reorder write operations to the linkdb and pagedb. It is useful only for objects like UpdateDatabaseTool, which just does writes. The WebDBWriter is a traditional single-pass database writer. It does not cache any instructions to disk (but it does in memory, with possible resorting). It certainly does nothing in a distributed fashion. There are other implementors of IWebDBWriter that do all that fancy stuff.
Nested Class Summary | |
static class |
WebDBWriter.LinkInstruction
Holds an instruction over a Link. |
static class |
WebDBWriter.LinkInstructionWriter
LinkInstructionWriter very efficiently writes a LinkInstruction to a SequenceFile.Writer. |
static class |
WebDBWriter.PageInstruction
PageInstruction holds an operation over a Page. |
static class |
WebDBWriter.PageInstructionWriter
PageInstructionWriter very efficiently writes a PageInstruction to a SequenceFile.Writer. |
Constructor Summary | |
WebDBWriter(NutchFileSystem fs,
File dbDir)
Create a WebDBWriter. |
Method Summary | |
void |
addLink(Link lr)
Add a link to the link database |
void |
addPage(Page page)
Add a page to the page database |
void |
addPageIfNotPresent(Page page)
Don't replace the one in the database, if there is one. |
void |
addPageIfNotPresent(Page page,
Link link)
Don't replace the one in the database, if there is one. |
void |
addPageWithScore(Page page)
Add a page to the page database, with a brand-new score |
void |
close()
Shutdown |
static void |
createWebDB(NutchFileSystem nfs,
File dbDir)
Create the WebDB for the first time. |
void |
deleteLink(MD5Hash md5)
Remove links with the given MD5 from the db. |
void |
deletePage(String url)
Remove a page from the page database. |
static void |
main(String[] argv)
The WebDBWriter.main() provides some handy methods for testing the WebDB. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WebDBWriter(NutchFileSystem fs, File dbDir) throws IOException
Method Detail |
public static void createWebDB(NutchFileSystem nfs, File dbDir) throws IOException
IOException
public void close() throws IOException
close
in interface IWebDBWriter
IOException
public void addPage(Page page) throws IOException
addPage
in interface IWebDBWriter
IOException
public void addPageWithScore(Page page) throws IOException
addPageWithScore
in interface IWebDBWriter
IOException
public void addPageIfNotPresent(Page page) throws IOException
addPageIfNotPresent
in interface IWebDBWriter
IOException
public void addPageIfNotPresent(Page page, Link link) throws IOException
addPageIfNotPresent
in interface IWebDBWriter
IOException
public void deletePage(String url) throws IOException
deletePage
in interface IWebDBWriter
IOException
public void addLink(Link lr) throws IOException
addLink
in interface IWebDBWriter
IOException
public void deleteLink(MD5Hash md5) throws IOException
IOException
public static void main(String[] argv) throws FileNotFoundException, IOException
FileNotFoundException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |