flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StephanEwen <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-3102] Allow reading from multiple topic...
Date Mon, 07 Dec 2015 15:49:48 GMT
Github user StephanEwen commented on a diff in the pull request:

    --- 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
    +		//noinspection unchecked
    +		HashMap<KafkaTopicPartition, Long> currentOffsets = (HashMap<KafkaTopicPartition,
Long>) lastOffsets.clone();
    --- End diff --
    Clone is probably a bit more efficient even, as does not hash but only copy the table.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message