public class JDBCOutputFormat extends Object implements org.apache.flink.api.common.io.OutputFormat<org.apache.flink.types.Record>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
JDBCOutputFormat.AbstractConfigBuilder<T>
Abstract builder used to set parameters to the output format's
configuration in a fluent way.
|
static class |
JDBCOutputFormat.ConfigBuilder
A builder used to set parameters to the output format's configuration in a fluent way.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
BATCH_INTERVAL |
static String |
DRIVER_KEY |
static String |
FIELD_COUNT_KEY |
static String |
FIELD_TYPE_KEY |
static String |
PASSWORD_KEY |
static String |
QUERY_KEY |
static String |
URL_KEY |
static String |
USERNAME_KEY |
| Constructor and Description |
|---|
JDBCOutputFormat() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Executes prepared statement and closes all resources of this instance.
|
void |
configure(org.apache.flink.configuration.Configuration parameters)
Configures this JDBCOutputFormat.
|
static JDBCOutputFormat.ConfigBuilder |
configureOutputFormat(org.apache.flink.api.java.record.operators.GenericDataSink target)
Creates a configuration builder that can be used to set the
output format's parameters to the config in a fluent fashion.
|
void |
open(int taskNumber,
int numTasks)
Connects to the target database and initializes the prepared statement.
|
void |
writeRecord(org.apache.flink.types.Record record)
Adds a record to the prepared statement.
|
public static final String DRIVER_KEY
public static final String USERNAME_KEY
public static final String PASSWORD_KEY
public static final String URL_KEY
public static final String QUERY_KEY
public static final String FIELD_COUNT_KEY
public static final String FIELD_TYPE_KEY
public static final String BATCH_INTERVAL
public void configure(org.apache.flink.configuration.Configuration parameters)
configure in interface org.apache.flink.api.common.io.OutputFormat<org.apache.flink.types.Record>parameters - Configuration containing all parameters.public void open(int taskNumber,
int numTasks)
throws IOException
open in interface org.apache.flink.api.common.io.OutputFormat<org.apache.flink.types.Record>taskNumber - The number of the parallel instance.IOException - Thrown, if the output could not be opened due to an
I/O problem.public void writeRecord(org.apache.flink.types.Record record)
throws IOException
When this method is called, the output format is guaranteed to be opened.
writeRecord in interface org.apache.flink.api.common.io.OutputFormat<org.apache.flink.types.Record>record - 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
close in interface org.apache.flink.api.common.io.OutputFormat<org.apache.flink.types.Record>IOException - Thrown, if the input could not be closed properly.public static JDBCOutputFormat.ConfigBuilder configureOutputFormat(org.apache.flink.api.java.record.operators.GenericDataSink target)
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.