org.apache.hadoop.mapred.lib.db
Class DBOutputFormat.DBRecordWriter

java.lang.Object
  extended by org.apache.hadoop.mapred.lib.db.DBOutputFormat.DBRecordWriter
All Implemented Interfaces:
RecordWriter<K,V>
Enclosing class:
DBOutputFormat<K extends DBWritable,V>

protected class DBOutputFormat.DBRecordWriter
extends java.lang.Object
implements RecordWriter<K,V>

A RecordWriter that writes the reduce output to a SQL table


Constructor Summary
protected DBOutputFormat.DBRecordWriter(java.sql.Connection connection, java.sql.PreparedStatement statement)
           
 
Method Summary
 void close(Reporter reporter)
          Close this RecordWriter to future operations.
 void write(K key, V value)
          Writes a key/value pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBOutputFormat.DBRecordWriter

protected DBOutputFormat.DBRecordWriter(java.sql.Connection connection,
                                        java.sql.PreparedStatement statement)
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

close

public void close(Reporter reporter)
           throws java.io.IOException
Close this RecordWriter to future operations.

Specified by:
close in interface RecordWriter<K extends DBWritable,V>
Parameters:
reporter - facility to report progress.
Throws:
java.io.IOException

write

public void write(K key,
                  V value)
           throws java.io.IOException
Writes a key/value pair.

Specified by:
write in interface RecordWriter<K extends DBWritable,V>
Parameters:
key - the key to write.
value - the value to write.
Throws:
java.io.IOException


Copyright © 2009 The Apache Software Foundation