You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/12/11 08:04:44 UTC

[GitHub] [flink] wuchong commented on a change in pull request #13907: [FLINK-19942][Connectors / JDBC]Support sink parallelism configuration to JDBC connector

wuchong commented on a change in pull request #13907:
URL: https://github.com/apache/flink/pull/13907#discussion_r540754136



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/connector/sink/OutputFormatProvider.java
##########
@@ -23,17 +23,29 @@
 import org.apache.flink.table.connector.ParallelismProvider;
 import org.apache.flink.table.data.RowData;
 
+import java.util.Optional;
+
 /**
  * Provider of an {@link OutputFormat} instance as a runtime implementation for {@link DynamicTableSink}.
  */
 @PublicEvolving
 public interface OutputFormatProvider extends DynamicTableSink.SinkRuntimeProvider, ParallelismProvider {
 
 	/**
-	 * Helper method for creating a static provider.
+	 * Helper method for creating a static provider with a provided sink parallelism.
 	 */
-	static OutputFormatProvider of(OutputFormat<RowData> outputFormat) {
-		return () -> outputFormat;
+	static OutputFormatProvider of(OutputFormat<RowData> outputFormat, Integer sinkParallelism) {

Review comment:
       This is a public API. Please add a new method instead of changing the existing one, otherwise, it's not API compatible. 

##########
File path: flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/JdbcExecutionOptions.java
##########
@@ -35,12 +35,18 @@
 	private final long batchIntervalMs;
 	private final int batchSize;
 	private final int maxRetries;
+	private final Integer parallelism;
 
-	private JdbcExecutionOptions(long batchIntervalMs, int batchSize, int maxRetries) {
+	private JdbcExecutionOptions(
+			long batchIntervalMs,
+			int batchSize,
+			int maxRetries,
+			Integer parallelism) {

Review comment:
       I'm not sure about adding this to `JdbcExecutionOptions`, because `JdbcExecutionOptions` is an public API for `JdbcSink`. For `JdbcSink#sink`, this may looks weird because the configured parallelism doesn't work as the returned object is `SinkFunction`.
   
   Another option is adding the parallelism to `JdbcDmlOption` or `JdbcOption`, they are both internal class. 




----------------------------------------------------------------
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:
users@infra.apache.org