public class JDBCUpsertOutputFormat extends AbstractJDBCOutputFormat<org.apache.flink.api.java.tuple.Tuple2<Boolean,org.apache.flink.types.Row>>
| 限定符和类型 | 类和说明 |
|---|---|
static class |
JDBCUpsertOutputFormat.Builder
Builder for a
JDBCUpsertOutputFormat. |
connection, dbURL| 构造器和说明 |
|---|
JDBCUpsertOutputFormat(JDBCOptions options,
String[] fieldNames,
String[] keyFields,
int[] fieldTypes,
int flushMaxSize,
long flushIntervalMills,
int maxRetryTimes) |
| 限定符和类型 | 方法和说明 |
|---|---|
static JDBCUpsertOutputFormat.Builder |
builder() |
void |
close()
Executes prepared statement and closes all resources of this instance.
|
void |
flush() |
void |
open(int taskNumber,
int numTasks)
Connects to the target database and initializes the prepared statement.
|
void |
writeRecord(org.apache.flink.api.java.tuple.Tuple2<Boolean,org.apache.flink.types.Row> tuple2) |
closeDbConnection, configure, establishConnectionpublic JDBCUpsertOutputFormat(JDBCOptions options, String[] fieldNames, String[] keyFields, int[] fieldTypes, int flushMaxSize, long flushIntervalMills, int maxRetryTimes)
public void open(int taskNumber,
int numTasks)
throws IOException
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.api.java.tuple.Tuple2<Boolean,org.apache.flink.types.Row> tuple2) throws IOException
IOExceptionpublic void close()
throws IOException
IOException - Thrown, if the input could not be closed properly.public static JDBCUpsertOutputFormat.Builder builder()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.