[
https://issues.apache.org/jira/browse/FLINK-10843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16686197#comment-16686197
]
ASF GitHub Bot commented on FLINK-10843:
----------------------------------------
twalthr commented on a change in pull request #7087: [FLINK-10843] [connectors]
Make Kafka table factory versioning more flexible
URL: https://github.com/apache/flink/pull/7087#discussion_r233350930
##########
File path:
flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSourceSinkFactoryBase.java
##########
@@ -187,9 +190,21 @@
//
--------------------------------------------------------------------------------------------
/**
- * Returns the Kafka version.
+ * Returns a hard-coded Kafka version.
+ *
+ * @deprecated This method can be dropped once we only maintain the
universal Kafka connector.
*/
- protected abstract String kafkaVersion();
+ @Deprecated
+ protected abstract Optional<String> kafkaVersion();
+
+ /**
+ * Returns the pattern that a validator should accept as Kafka version.
+ */
+ protected Pattern[] kafkaVersionPattern() {
Review comment:
The reason for two separate methods was that the previous factories
explicitly matched only if the version was correct. But I agree that the logic
might have been unnecessarily complicated. I removed the `kafkaVersion()`
method. I think `Pattern` is still fine because is not a dependency and also
not exposed as factories are a pure Flink internal thing. Once we drop the old
Kafka connectors we don't need to "expose" the pattern anymore.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Make Kafka version definition more flexible for new Kafka table factory
> -----------------------------------------------------------------------
>
> Key: FLINK-10843
> URL: https://issues.apache.org/jira/browse/FLINK-10843
> Project: Flink
> Issue Type: Bug
> Components: Kafka Connector, Table API & SQL
> Affects Versions: 1.7.0
> Reporter: Timo Walther
> Assignee: Timo Walther
> Priority: Major
> Labels: pull-request-available
>
> Currently, a user has to specify a specific version for a Kafka connector
> like:
> {code}
> connector:
> type: kafka
> version: "0.11" # required: valid connector versions are "0.8", "0.9",
> "0.10", and "0.11"
> topic: ... # required: topic name from which the table is read
> {code}
> However, the new Kafka connector aims to be universal, thus, at least for 1.x
> and 2.x versions which we should support those as parameters as well.
> Currently, {{2.0}} is the only accepted string for the factory.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)