JingsongLi commented on a change in pull request #10468: [FLINK-14649][table
sql / api] Flatten all the connector properties keys to make it easy to
configure in DDL
URL: https://github.com/apache/flink/pull/10468#discussion_r355122148
##########
File path:
flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSourceSinkFactoryBase.java
##########
@@ -322,6 +333,26 @@ private StartupOptions getStartupOptions(
return options;
}
+ private void buildSpecificOffsets(DescriptorProperties
descriptorProperties, String topic, Map<KafkaTopicPartition, Long>
specificOffsets) {
+ if
(descriptorProperties.containsKey(CONNECTOR_SPECIFIC_OFFSETS)) {
+ final Map<Integer, Long> offsetMap =
KafkaValidator.validateAndGetSpecificOffsetsStr(descriptorProperties);
+ offsetMap.forEach((partition, offset) -> {
+ final KafkaTopicPartition topicPartition = new
KafkaTopicPartition(topic, partition);
+ specificOffsets.put(topicPartition, offset);
+ });
+ } else {
+ final List<Map<String, String>> offsetList =
descriptorProperties.getFixedIndexedProperties(
+ CONNECTOR_SPECIFIC_OFFSETS,
+
Arrays.asList(CONNECTOR_SPECIFIC_OFFSETS_PARTITION,
CONNECTOR_SPECIFIC_OFFSETS_OFFSET));
+ offsetList.forEach(kv -> {
+ final int partition =
descriptorProperties.getInt(kv.get(CONNECTOR_SPECIFIC_OFFSETS_PARTITION));
Review comment:
Don't need every field contains `final`.
----------------------------------------------------------------
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