org.apache.nutch.tools.compat
Class CrawlDbConverter

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.nutch.tools.compat.CrawlDbConverter
All Implemented Interfaces:
Closeable, Configurable, JobConfigurable, Mapper<WritableComparable,CrawlDatum,Text,CrawlDatum>, Tool

public class CrawlDbConverter
extends Configured
implements Tool, Mapper<WritableComparable,CrawlDatum,Text,CrawlDatum>

This tool converts CrawlDb created in old <UTF8, CrawlDatum> format (Nutch versions < 0.9.0) to the new <Text, CrawlDatum> format. Optionally CrawlDatum.metaData can be converted too from using UTF8 keys to using Text keys.

Author:
Andrzej Bialecki

Constructor Summary
CrawlDbConverter()
           
 
Method Summary
 void close()
           
 void configure(JobConf job)
           
static void main(String[] args)
           
 void map(WritableComparable key, CrawlDatum value, OutputCollector<Text,CrawlDatum> output, Reporter reporter)
           
 int run(String[] args)
           
 
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
 
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
 

Constructor Detail

CrawlDbConverter

public CrawlDbConverter()
Method Detail

configure

public void configure(JobConf job)
Specified by:
configure in interface JobConfigurable

map

public void map(WritableComparable key,
                CrawlDatum value,
                OutputCollector<Text,CrawlDatum> output,
                Reporter reporter)
         throws IOException
Specified by:
map in interface Mapper<WritableComparable,CrawlDatum,Text,CrawlDatum>
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

main

public static void main(String[] args)
                 throws Exception
Parameters:
args -
Throws:
Exception

run

public int run(String[] args)
        throws Exception
Specified by:
run in interface Tool
Throws:
Exception


Copyright © 2006 The Apache Software Foundation