[
https://issues.apache.org/jira/browse/FLINK-3102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15044833#comment-15044833
]
ASF GitHub Bot commented on FLINK-3102:
---------------------------------------
Github user aljoscha commented on a diff in the pull request:
https://github.com/apache/flink/pull/1437#discussion_r46814334
--- Diff:
flink-streaming-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumer.java
---
@@ -516,10 +510,12 @@ public void close() throws Exception {
if (LOG.isDebugEnabled()) {
LOG.debug("Snapshotting state. Offsets: {}, checkpoint
id: {}, timestamp: {}",
- Arrays.toString(lastOffsets),
checkpointId, checkpointTimestamp);
+
KafkaTopicPartition.toString(lastOffsets), checkpointId, checkpointTimestamp);
}
- long[] currentOffsets = Arrays.copyOf(lastOffsets,
lastOffsets.length);
+ // the use of clone() is okay here is okay, we just need a new
map, the keys are not changed
+ //noinspection unchecked
+ HashMap<KafkaTopicPartition, Long> currentOffsets =
(HashMap<KafkaTopicPartition, Long>) lastOffsets.clone();
--- End diff --
Why don't you use `new HashMap<>(lastOffsets)` here?
> Allow reading from multiple topics with one FlinkKafkaConsumer
> --------------------------------------------------------------
>
> Key: FLINK-3102
> URL: https://issues.apache.org/jira/browse/FLINK-3102
> Project: Flink
> Issue Type: New Feature
> Components: Kafka Connector
> Reporter: Robert Metzger
> Assignee: Robert Metzger
>
> Currently, a Kafka consumer allows to read from only one topic.
> For cases where multiple topics contain messages with the same schema, it is
> useful to allow to subscribe to many topics using one FlinkKafkaConsumer
> instance.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)