OUT
- public class JDBCOutputFormat<OUT extends Tuple> extends RichOutputFormat<OUT>
Tuple
,
DriverManager
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
JDBCOutputFormat.JDBCOutputFormatBuilder |
Constructor and Description |
---|
JDBCOutputFormat() |
Modifier and Type | Method and Description |
---|---|
static JDBCOutputFormat.JDBCOutputFormatBuilder |
buildJDBCOutputFormat() |
void |
close()
Executes prepared statement and closes all resources of this instance.
|
void |
configure(Configuration parameters)
Configures this output format.
|
void |
open(int taskNumber,
int numTasks)
Connects to the target database and initializes the prepared statement.
|
void |
writeRecord(OUT tuple)
Adds a record to the prepared statement.
|
getRuntimeContext, setRuntimeContext
public void configure(Configuration parameters)
OutputFormat
This method is always called first on a newly instantiated output format.
parameters
- The configuration with all parameters.public void open(int taskNumber, int numTasks) throws IOException
taskNumber
- The number of the parallel instance.numTasks
- The number of parallel tasks.IOException
- Thrown, if the output could not be opened due to an
I/O problem.public void writeRecord(OUT tuple) throws IOException
When this method is called, the output format is guaranteed to be opened.
tuple
- The records to add to the output.IOException
- Thrown, if the records could not be added due to an I/O problem.public void close() throws IOException
IOException
- Thrown, if the input could not be closed properly.public static JDBCOutputFormat.JDBCOutputFormatBuilder buildJDBCOutputFormat()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.