[TOC]

org.apache.nutch.scoring.webgraph

Class Loops.Looper

  • java.lang.Object
    • org.apache.hadoop.conf.Configured
    • org.apache.nutch.scoring.webgraph.Loops.Looper
    • All Implemented Interfaces:
    • Closeable, AutoCloseable, org.apache.hadoop.conf.Configurable, org.apache.hadoop.mapred.JobConfigurable, org.apache.hadoop.mapred.Mapper, org.apache.hadoop.mapred.Reducer
    • Enclosing class:
    • Loops

public static class Loops.Looper
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.mapred.Mapper<org.apache.hadoop.io.Text,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Text,org.apache.hadoop.io.ObjectWritable>, org.apache.hadoop.mapred.Reducer<org.apache.hadoop.io.Text,org.apache.hadoop.io.ObjectWritable,org.apache.hadoop.io.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

Constructors Constructor and Description Loops.Looper() Default constructor. Loops.Looper(org.apache.hadoop.conf.Configuration conf) Configurable constructor.

Method Summary

Methods Modifier and Type Method and Description void close() void configure(org.apache.hadoop.mapred.JobConf conf) Configure the job. void map(org.apache.hadoop.io.Text key, org.apache.hadoop.io.Writable value, org.apache.hadoop.mapred.OutputCollector output, org.apache.hadoop.mapred.Reporter reporter) Wrap values in ObjectWritable. void reduce(org.apache.hadoop.io.Text key, Iterator values, org.apache.hadoop.mapred.OutputCollector output, org.apache.hadoop.mapred.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(org.apache.hadoop.conf.Configuration conf)

Configurable constructor.

Method Detail

-  

configure

public void configure(org.apache.hadoop.mapred.JobConf conf)

Configure the job.

  - Specified by: 
  - <code>configure</code> in interface <code>org.apache.hadoop.mapred.JobConfigurable</code>        
-  

map

public void map(org.apache.hadoop.io.Text key,
       org.apache.hadoop.io.Writable value,
       org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,org.apache.hadoop.io.ObjectWritable> output,
       org.apache.hadoop.mapred.Reporter reporter)
         throws IOException

Wrap values in ObjectWritable.

  - Specified by: 
  - <code>map</code> in interface <code>org.apache.hadoop.mapred.Mapper<org.apache.hadoop.io.text,org.apache.hadoop.io.writable,org.apache.hadoop.io.text,org.apache.hadoop.io.objectwritable></org.apache.hadoop.io.text,org.apache.hadoop.io.writable,org.apache.hadoop.io.text,org.apache.hadoop.io.objectwritable></code> 
  - Throws: 
  - <code>IOException</code>       
-  

reduce

public void reduce(org.apache.hadoop.io.Text key,
          Iterator<org.apache.hadoop.io.ObjectWritable> values,
          org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,Loops.Route> output,
          org.apache.hadoop.mapred.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: 
  - <code>reduce</code> in interface <code>org.apache.hadoop.mapred.Reducer<org.apache.hadoop.io.text,org.apache.hadoop.io.objectwritable,org.apache.hadoop.io.text,loops.route></org.apache.hadoop.io.text,org.apache.hadoop.io.objectwritable,org.apache.hadoop.io.text,loops.route></code> 
  - Throws: 
  - <code>IOException</code>       
-  

close

public void close()
  - Specified by: 
  - <code>close</code> in interface <code>Closeable</code> 
  - Specified by: 
  - <code>close</code> in interface <code>AutoCloseable</code>       

Copyright © 2014 The Apache Software Foundation