public abstract class UpsertWriter extends Object implements JDBCWriter
Modifier and Type | Method and Description |
---|---|
void |
addRecord(Tuple2<Boolean,Row> record)
Add record to writer, the writer may cache the data.
|
void |
close()
Close JDBC related statements and other classes.
|
static UpsertWriter |
create(JDBCDialect dialect,
String tableName,
String[] fieldNames,
int[] fieldTypes,
String[] keyFields) |
void |
executeBatch()
Submits a batch of commands to the database for execution.
|
void |
open(Connection connection)
Open the writer by JDBC Connection.
|
public static UpsertWriter create(JDBCDialect dialect, String tableName, String[] fieldNames, int[] fieldTypes, String[] keyFields)
public void open(Connection connection) throws SQLException
JDBCWriter
open
in interface JDBCWriter
SQLException
public void addRecord(Tuple2<Boolean,Row> record)
JDBCWriter
addRecord
in interface JDBCWriter
public void executeBatch() throws SQLException
JDBCWriter
executeBatch
in interface JDBCWriter
SQLException
public void close() throws SQLException
JDBCWriter
close
in interface JDBCWriter
SQLException
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.