org.apache.hadoop.hbase.mapreduce
Class IndexRecordWriter

java.lang.Object
  extended by org.apache.hadoop.mapreduce.RecordWriter<ImmutableBytesWritable,LuceneDocumentWrapper>
      extended by org.apache.hadoop.hbase.mapreduce.IndexRecordWriter

public class IndexRecordWriter
extends org.apache.hadoop.mapreduce.RecordWriter<ImmutableBytesWritable,LuceneDocumentWrapper>

Writes the records into a Lucene index writer.


Constructor Summary
IndexRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context, org.apache.hadoop.fs.FileSystem fs, org.apache.lucene.index.IndexWriter writer, IndexConfiguration indexConf, org.apache.hadoop.fs.Path perm, org.apache.hadoop.fs.Path temp)
          Creates a new instance.
 
Method Summary
 void close(org.apache.hadoop.mapreduce.TaskAttemptContext context)
          Closes the writer.
 void write(ImmutableBytesWritable key, LuceneDocumentWrapper value)
          Writes the record into an index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexRecordWriter

public IndexRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context,
                         org.apache.hadoop.fs.FileSystem fs,
                         org.apache.lucene.index.IndexWriter writer,
                         IndexConfiguration indexConf,
                         org.apache.hadoop.fs.Path perm,
                         org.apache.hadoop.fs.Path temp)
Creates a new instance.

Parameters:
context - The task context.
fs - The file system.
writer - The index writer.
indexConf - The index configuration.
perm - The permanent path in the DFS.
temp - The temporary local path.
Method Detail

write

public void write(ImmutableBytesWritable key,
                  LuceneDocumentWrapper value)
           throws IOException
Writes the record into an index.

Specified by:
write in class org.apache.hadoop.mapreduce.RecordWriter<ImmutableBytesWritable,LuceneDocumentWrapper>
Parameters:
key - The current key.
value - The current value.
Throws:
IOException - When the index is faulty.
See Also:
RecordWriter.write(java.lang.Object, java.lang.Object)

close

public void close(org.apache.hadoop.mapreduce.TaskAttemptContext context)
           throws IOException
Closes the writer.

Specified by:
close in class org.apache.hadoop.mapreduce.RecordWriter<ImmutableBytesWritable,LuceneDocumentWrapper>
Parameters:
context - The current context.
Throws:
IOException - When closing the writer fails.
See Also:
RecordWriter.close(org.apache.hadoop.mapreduce.TaskAttemptContext)


Copyright © 2009 The Apache Software Foundation