org.apache.nutch.segment
Class SegmentReader

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.nutch.segment.SegmentReader
All Implemented Interfaces:
Closeable, Configurable, JobConfigurable, Reducer<Text,NutchWritable,Text,Text>

public class SegmentReader
extends Configured
implements Reducer<Text,NutchWritable,Text,Text>

Dump the content of a segment.


Nested Class Summary
static class SegmentReader.InputCompatMapper
           
static class SegmentReader.SegmentReaderStats
           
static class SegmentReader.TextOutputFormat
          Implements a text output format
 
Field Summary
static org.slf4j.Logger LOG
           
 
Constructor Summary
SegmentReader()
           
SegmentReader(Configuration conf, boolean co, boolean fe, boolean ge, boolean pa, boolean pd, boolean pt)
           
 
Method Summary
 void close()
           
 void configure(JobConf job)
           
 void dump(Path segment, Path output)
           
 void get(Path segment, Text key, Writer writer, Map<String,List<Writable>> results)
           
 void getStats(Path segment, SegmentReader.SegmentReaderStats stats)
           
 void list(List<Path> dirs, Writer writer)
           
static void main(String[] args)
           
 void reduce(Text key, Iterator<NutchWritable> values, OutputCollector<Text,Text> output, Reporter reporter)
           
 
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
 

Field Detail

LOG

public static final org.slf4j.Logger LOG
Constructor Detail

SegmentReader

public SegmentReader()

SegmentReader

public SegmentReader(Configuration conf,
                     boolean co,
                     boolean fe,
                     boolean ge,
                     boolean pa,
                     boolean pd,
                     boolean pt)
Method Detail

configure

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

close

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

reduce

public void reduce(Text key,
                   Iterator<NutchWritable> values,
                   OutputCollector<Text,Text> output,
                   Reporter reporter)
            throws IOException
Specified by:
reduce in interface Reducer<Text,NutchWritable,Text,Text>
Throws:
IOException

dump

public void dump(Path segment,
                 Path output)
          throws IOException
Throws:
IOException

get

public void get(Path segment,
                Text key,
                Writer writer,
                Map<String,List<Writable>> results)
         throws Exception
Throws:
Exception

list

public void list(List<Path> dirs,
                 Writer writer)
          throws Exception
Throws:
Exception

getStats

public void getStats(Path segment,
                     SegmentReader.SegmentReaderStats stats)
              throws Exception
Throws:
Exception

main

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


Copyright © 2011 The Apache Software Foundation