org.apache.nutch.indexer.field
Class BasicFields.Flipper

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.nutch.indexer.field.BasicFields.Flipper
All Implemented Interfaces:
Closeable, Configurable, JobConfigurable, Mapper<Text,Writable,Text,ObjectWritable>, Reducer<Text,ObjectWritable,Text,LinkDatum>
Enclosing class:
BasicFields

public static class BasicFields.Flipper
extends Configured
implements Mapper<Text,Writable,Text,ObjectWritable>, Reducer<Text,ObjectWritable,Text,LinkDatum>

Runs the first part of redirect logic. Breaks out fields if a page contains a redirect.


Constructor Summary
BasicFields.Flipper()
           
 
Method Summary
 void close()
           
 void configure(JobConf conf)
          Configures the job.
 void map(Text key, Writable value, OutputCollector<Text,ObjectWritable> output, Reporter reporter)
          Breaks out the collection of fields for url and redirects if necessary.
 void reduce(Text key, Iterator<ObjectWritable> values, OutputCollector<Text,LinkDatum> output, Reporter reporter)
          Collects redirect and original links for a given url key.
 
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

BasicFields.Flipper

public BasicFields.Flipper()
Method Detail

configure

public void configure(JobConf conf)
Configures the job.

Specified by:
configure in interface JobConfigurable

close

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

map

public void map(Text key,
                Writable value,
                OutputCollector<Text,ObjectWritable> output,
                Reporter reporter)
         throws IOException
Breaks out the collection of fields for url and redirects if necessary.

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

reduce

public void reduce(Text key,
                   Iterator<ObjectWritable> values,
                   OutputCollector<Text,LinkDatum> output,
                   Reporter reporter)
            throws IOException
Collects redirect and original links for a given url key. This will be used in the Scorer to handle redirects.

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


Copyright © 2006 The Apache Software Foundation