rkhachatryan commented on a change in pull request #11061: [FLINK-15782]
[connectors/jdbc] JDBC sink DataStream API
URL: https://github.com/apache/flink/pull/11061#discussion_r389950670
##########
File path:
flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/executor/JdbcBatchStatementExecutor.java
##########
@@ -16,29 +16,27 @@
* limitations under the License.
*/
-package org.apache.flink.api.java.io.jdbc.writer;
+package org.apache.flink.api.java.io.jdbc.executor;
-import org.apache.flink.api.java.tuple.Tuple2;
-import org.apache.flink.types.Row;
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.java.io.jdbc.JdbcStatementBuilder;
-import java.io.Serializable;
import java.sql.Connection;
import java.sql.SQLException;
+import java.util.function.Function;
/**
- * JDBCWriter used to execute statements (e.g. INSERT, UPSERT, DELETE).
+ * Executes the given JDBC statement in batch for the accumulated records.
*/
-public interface JDBCWriter extends Serializable {
+@Internal
+public interface JdbcBatchStatementExecutor<T> {
Review comment:
On higher levels, it is wrapped because there the allowed exception is
`IOException`, not `SQLException`. So we can only declare `throws IOException`
without wrapping.
But IMO `SQLException` is better here because:
- caller can actually do something with it
- it has an appropriate abstraction level
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services