org.apache.nutch.searcher
Class FetchedSegments

java.lang.Object
  extended by org.apache.nutch.searcher.FetchedSegments
All Implemented Interfaces:
Closeable, VersionedProtocol, HitContent, HitSummarizer, RPCSegmentBean, SegmentBean

public class FetchedSegments
extends Object
implements RPCSegmentBean

Implements HitSummarizer and HitContent for a set of fetched segments.


Field Summary
static long VERSION
           
 
Constructor Summary
FetchedSegments(Configuration conf, Path segmentsDir)
          Construct given a directory containing fetcher output.
 
Method Summary
 void close()
           
 byte[] getContent(HitDetails details)
          Returns the content of a hit document.
 long getFetchDate(HitDetails details)
          Returns the fetch date of a hit document.
 ParseData getParseData(HitDetails details)
          Returns the ParseData of a hit document.
 ParseText getParseText(HitDetails details)
          Returns the ParseText of a hit document.
 long getProtocolVersion(String protocol, long clientVersion)
           
 String[] getSegmentNames()
           
 Summary[] getSummary(HitDetails[] details, Query query)
          Returns summaries for a set of details.
 Summary getSummary(HitDetails details, Query query)
          Returns a summary for the given hit details.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final long VERSION
See Also:
Constant Field Values
Constructor Detail

FetchedSegments

public FetchedSegments(Configuration conf,
                       Path segmentsDir)
                throws IOException
Construct given a directory containing fetcher output.

Throws:
IOException
Method Detail

getSegmentNames

public String[] getSegmentNames()
Specified by:
getSegmentNames in interface SegmentBean

getContent

public byte[] getContent(HitDetails details)
                  throws IOException
Description copied from interface: HitContent
Returns the content of a hit document.

Specified by:
getContent in interface HitContent
Throws:
IOException

getParseData

public ParseData getParseData(HitDetails details)
                       throws IOException
Description copied from interface: HitContent
Returns the ParseData of a hit document.

Specified by:
getParseData in interface HitContent
Throws:
IOException

getFetchDate

public long getFetchDate(HitDetails details)
                  throws IOException
Description copied from interface: HitContent
Returns the fetch date of a hit document.

Specified by:
getFetchDate in interface HitContent
Throws:
IOException

getParseText

public ParseText getParseText(HitDetails details)
                       throws IOException
Description copied from interface: HitContent
Returns the ParseText of a hit document.

Specified by:
getParseText in interface HitContent
Throws:
IOException

getSummary

public Summary getSummary(HitDetails details,
                          Query query)
                   throws IOException
Description copied from interface: HitSummarizer
Returns a summary for the given hit details.

Specified by:
getSummary in interface HitSummarizer
Parameters:
details - the details of the hit to be summarized
query - indicates what should be higlighted in the summary text
Throws:
IOException

getProtocolVersion

public long getProtocolVersion(String protocol,
                               long clientVersion)
                        throws IOException
Specified by:
getProtocolVersion in interface VersionedProtocol
Throws:
IOException

getSummary

public Summary[] getSummary(HitDetails[] details,
                            Query query)
                     throws IOException
Description copied from interface: HitSummarizer
Returns summaries for a set of details. Hook for parallel IPC calls.

Specified by:
getSummary in interface HitSummarizer
Parameters:
details - the details of hits to be summarized
query - indicates what should be higlighted in the summary text
Throws:
IOException

close

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


Copyright © 2006 The Apache Software Foundation