public class ScoreUpdater extends Configured implements Tool, Mapper<Text,Writable,Text,ObjectWritable>, Reducer<Text,ObjectWritable,Text,CrawlDatum>
| Constructor and Description |
|---|
ScoreUpdater() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
configure(JobConf conf) |
static void |
main(java.lang.String[] args) |
void |
map(Text key,
Writable value,
OutputCollector<Text,ObjectWritable> output,
Reporter reporter)
Changes input into ObjectWritables.
|
void |
reduce(Text key,
java.util.Iterator<ObjectWritable> values,
OutputCollector<Text,CrawlDatum> output,
Reporter reporter)
Creates new CrawlDatum objects with the updated score from the NodeDb or
with a cleared score.
|
int |
run(java.lang.String[] args)
Runs the ScoreUpdater tool.
|
void |
update(Path crawlDb,
Path webGraphDb)
Updates the inlink score in the web graph node databsae into the crawl
database.
|
getConf, setConfclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConf, setConfpublic void configure(JobConf conf)
configure in interface JobConfigurablepublic void map(Text key, Writable value, OutputCollector<Text,ObjectWritable> output, Reporter reporter) throws java.io.IOException
public void reduce(Text key, java.util.Iterator<ObjectWritable> values, OutputCollector<Text,CrawlDatum> output, Reporter reporter) throws java.io.IOException
reduce in interface Reducer<Text,ObjectWritable,Text,CrawlDatum>java.io.IOExceptionpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic void update(Path crawlDb, Path webGraphDb) throws java.io.IOException
crawlDb - The crawl database to updatewebGraphDb - The webgraph database to use.java.io.IOException - If an error occurs while updating the scores.public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.ExceptionCopyright © 2017 The Apache Software Foundation