org.apache.hadoop.hbase.mapreduce
Class TableOutputFormat.TableRecordWriter<KEY>

java.lang.Object
  extended by org.apache.hadoop.mapreduce.RecordWriter<KEY,org.apache.hadoop.io.Writable>
      extended by org.apache.hadoop.hbase.mapreduce.TableOutputFormat.TableRecordWriter<KEY>
Type Parameters:
KEY - The type of the key.
Enclosing class:
TableOutputFormat<KEY>

protected static class TableOutputFormat.TableRecordWriter<KEY>
extends org.apache.hadoop.mapreduce.RecordWriter<KEY,org.apache.hadoop.io.Writable>

Writes the reducer output to an HBase table.


Constructor Summary
TableOutputFormat.TableRecordWriter(HTable table)
          Instantiate a TableRecordWriter with the HBase HClient for writing.
 
Method Summary
 void close(org.apache.hadoop.mapreduce.TaskAttemptContext context)
          Closes the writer, in this case flush table commits.
 void write(KEY key, org.apache.hadoop.io.Writable value)
          Writes a key/value pair into the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableOutputFormat.TableRecordWriter

public TableOutputFormat.TableRecordWriter(HTable table)
Instantiate a TableRecordWriter with the HBase HClient for writing.

Parameters:
table - The table to write to.
Method Detail

close

public void close(org.apache.hadoop.mapreduce.TaskAttemptContext context)
           throws IOException
Closes the writer, in this case flush table commits.

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

write

public void write(KEY key,
                  org.apache.hadoop.io.Writable value)
           throws IOException
Writes a key/value pair into the table.

Specified by:
write in class org.apache.hadoop.mapreduce.RecordWriter<KEY,org.apache.hadoop.io.Writable>
Parameters:
key - The key.
value - The value.
Throws:
IOException - When writing fails.
See Also:
RecordWriter.write(java.lang.Object, java.lang.Object)


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.