org.apache.nutch.scoring.webgraph
Class Loops.Initializer

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.nutch.scoring.webgraph.Loops.Initializer
All Implemented Interfaces:
Closeable, Configurable, JobConfigurable, Mapper<Text,Writable,Text,ObjectWritable>, Reducer<Text,ObjectWritable,Text,Loops.Route>
Enclosing class:
Loops

public static class Loops.Initializer
extends Configured
implements Mapper<Text,Writable,Text,ObjectWritable>, Reducer<Text,ObjectWritable,Text,Loops.Route>

Initializes the Loop routes.


Constructor Summary
Loops.Initializer()
          Default constructor.
Loops.Initializer(Configuration conf)
          Configurable constructor.
 
Method Summary
 void close()
           
 void configure(JobConf conf)
          Configure the job.
 void map(Text key, Writable value, OutputCollector<Text,ObjectWritable> output, Reporter reporter)
          Wraps values in ObjectWritable.
 void reduce(Text key, Iterator<ObjectWritable> values, OutputCollector<Text,Loops.Route> output, Reporter reporter)
          Takes any node that has inlinks and sets up a route for all of its outlinks.
 
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

Loops.Initializer

public Loops.Initializer()
Default constructor.


Loops.Initializer

public Loops.Initializer(Configuration conf)
Configurable constructor.

Method Detail

configure

public void configure(JobConf conf)
Configure the job.

Specified by:
configure in interface JobConfigurable

map

public void map(Text key,
                Writable value,
                OutputCollector<Text,ObjectWritable> output,
                Reporter reporter)
         throws IOException
Wraps values in ObjectWritable.

Specified by:
map in interface Mapper<Text,Writable,Text,ObjectWritable>
Throws:
IOException

reduce

public void reduce(Text key,
                   Iterator<ObjectWritable> values,
                   OutputCollector<Text,Loops.Route> output,
                   Reporter reporter)
            throws IOException
Takes any node that has inlinks and sets up a route for all of its outlinks. These routes will then be followed to a maximum depth inside of the Looper job.

Specified by:
reduce in interface Reducer<Text,ObjectWritable,Text,Loops.Route>
Throws:
IOException

close

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


Copyright © 2012 The Apache Software Foundation