public class ScoreUpdater extends Configured implements Tool, Mapper<Text,Writable,Text,ObjectWritable>, Reducer<Text,ObjectWritable,Text,CrawlDatum>
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
ScoreUpdater() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
configure(JobConf conf) |
static void |
main(String[] args) |
void |
map(Text key,
Writable value,
OutputCollector<Text,ObjectWritable> output,
Reporter reporter)
Changes input into ObjectWritables.
|
void |
reduce(Text key,
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(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, setConf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConf, setConf
public void configure(JobConf conf)
configure
in interface JobConfigurable
public void map(Text key, Writable value, OutputCollector<Text,ObjectWritable> output, Reporter reporter) throws IOException
map
in interface Mapper<Text,Writable,Text,ObjectWritable>
IOException
public void reduce(Text key, Iterator<ObjectWritable> values, OutputCollector<Text,CrawlDatum> output, Reporter reporter) throws IOException
reduce
in interface Reducer<Text,ObjectWritable,Text,CrawlDatum>
IOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void update(Path crawlDb, Path webGraphDb) throws IOException
crawlDb
- The crawl database to updatewebGraphDb
- The webgraph database to use.IOException
- If an error occurs while updating the scores.Copyright © 2015 The Apache Software Foundation