org.apache.nutch.scoring.webgraph
Class NodeDumper.Dumper

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.nutch.scoring.webgraph.NodeDumper.Dumper
All Implemented Interfaces:
Closeable, Configurable, JobConfigurable, Mapper<Text,Node,Text,FloatWritable>, Reducer<Text,FloatWritable,Text,FloatWritable>
Enclosing class:
NodeDumper

public static class NodeDumper.Dumper
extends Configured
implements Mapper<Text,Node,Text,FloatWritable>, Reducer<Text,FloatWritable,Text,FloatWritable>

Outputs the hosts or domains with an associated value. This value consists of either the number of inlinks, the number of outlinks or the score. The computed value is then either the sum of all parts or the top value.


Constructor Summary
NodeDumper.Dumper()
           
 
Method Summary
 void close()
           
 void configure(JobConf conf)
           
 void map(Text key, Node node, OutputCollector<Text,FloatWritable> output, Reporter reporter)
          Outputs the host or domain as key for this record and numInlinks, numOutlinks or score as the value.
 void reduce(Text key, Iterator<FloatWritable> values, OutputCollector<Text,FloatWritable> output, Reporter reporter)
          Outputs either the sum or the top value for this record.
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeDumper.Dumper

public NodeDumper.Dumper()
Method Detail

configure

public void configure(JobConf conf)
Specified by:
configure in interface JobConfigurable

close

public void close()
Specified by:
close in interface Closeable

map

public void map(Text key,
                Node node,
                OutputCollector<Text,FloatWritable> output,
                Reporter reporter)
         throws IOException
Outputs the host or domain as key for this record and numInlinks, numOutlinks or score as the value.

Specified by:
map in interface Mapper<Text,Node,Text,FloatWritable>
Throws:
IOException

reduce

public void reduce(Text key,
                   Iterator<FloatWritable> values,
                   OutputCollector<Text,FloatWritable> output,
                   Reporter reporter)
            throws IOException
Outputs either the sum or the top value for this record.

Specified by:
reduce in interface Reducer<Text,FloatWritable,Text,FloatWritable>
Throws:
IOException


Copyright © 2012 The Apache Software Foundation