[TOC]

org.apache.nutch.scoring.webgraph

Class Loops.Initializer

  • java.lang.Object
    • org.apache.hadoop.conf.Configured
    • org.apache.nutch.scoring.webgraph.Loops.Initializer
    • 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.Initializer
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>

Initializes the Loop routes.

Constructor Summary

Constructors Constructor and Description Loops.Initializer() Default constructor. Loops.Initializer(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) Wraps 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) 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(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

Wraps 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

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: 
  - <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