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

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

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

Follows a route path looking for the start url of the route. If the start url is found then the route is a cyclical path.


Constructor Summary
Loops.Looper()
          Default constructor.
Loops.Looper(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)
          Wrap values in ObjectWritable.
 void reduce(Text key, Iterator<ObjectWritable> values, OutputCollector<Text,Loops.Route> output, Reporter reporter)
          Performs a single loop pass looking for loop cycles within routes.
 
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.Looper

public Loops.Looper()
Default constructor.


Loops.Looper

public Loops.Looper(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
Wrap 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
Performs a single loop pass looking for loop cycles within routes. If This is not the last loop cycle then url will be mapped for further passes.

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

close

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


Copyright © 2011 The Apache Software Foundation