org.apache.mahout.text
Class LuceneSegmentInputSplit

java.lang.Object
  extended by org.apache.hadoop.mapreduce.InputSplit
      extended by org.apache.mahout.text.LuceneSegmentInputSplit
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class LuceneSegmentInputSplit
extends org.apache.hadoop.mapreduce.InputSplit
implements org.apache.hadoop.io.Writable

InputSplit implementation that represents a Lucene segment.


Constructor Summary
LuceneSegmentInputSplit()
           
LuceneSegmentInputSplit(org.apache.hadoop.fs.Path indexPath, String segmentInfoName, long length)
           
 
Method Summary
 org.apache.hadoop.fs.Path getIndexPath()
           
 long getLength()
           
 String[] getLocations()
           
 org.apache.lucene.index.SegmentCommitInfo getSegment(org.apache.hadoop.conf.Configuration configuration)
          Get the SegmentInfo of this InputSplit via the given Configuration
 String getSegmentInfoName()
           
 void readFields(DataInput in)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneSegmentInputSplit

public LuceneSegmentInputSplit()

LuceneSegmentInputSplit

public LuceneSegmentInputSplit(org.apache.hadoop.fs.Path indexPath,
                               String segmentInfoName,
                               long length)
Method Detail

getLength

public long getLength()
               throws IOException,
                      InterruptedException
Specified by:
getLength in class org.apache.hadoop.mapreduce.InputSplit
Throws:
IOException
InterruptedException

getLocations

public String[] getLocations()
                      throws IOException,
                             InterruptedException
Specified by:
getLocations in class org.apache.hadoop.mapreduce.InputSplit
Throws:
IOException
InterruptedException

getSegmentInfoName

public String getSegmentInfoName()

getIndexPath

public org.apache.hadoop.fs.Path getIndexPath()

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

getSegment

public org.apache.lucene.index.SegmentCommitInfo getSegment(org.apache.hadoop.conf.Configuration configuration)
                                                     throws IOException
Get the SegmentInfo of this InputSplit via the given Configuration

Parameters:
configuration - the configuration used to locate the index
Returns:
the segment info or throws exception if not found
Throws:
IOException - if an error occurs when accessing the directory


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.