kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject kafka git commit: KAFKA-4728; KafkaConsumer#commitSync should copy its input
Date Mon, 06 Feb 2017 19:47:59 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 1f8a2ad2e -> b31a7a902


KAFKA-4728; KafkaConsumer#commitSync should copy its input

Author: Jan Lukavsky <jan.lukavsky@o2.cz>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #2491 from je-ik/KAFKA-4728


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/b31a7a90
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/b31a7a90
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/b31a7a90

Branch: refs/heads/trunk
Commit: b31a7a9022bfb645cb61e6fbc0b22829108b3a3f
Parents: 1f8a2ad
Author: Jan Lukavsky <jan.lukavsky@o2.cz>
Authored: Mon Feb 6 11:47:45 2017 -0800
Committer: Jason Gustafson <jason@confluent.io>
Committed: Mon Feb 6 11:47:45 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/kafka/clients/consumer/KafkaConsumer.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/b31a7a90/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java b/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
index 89844f6..449efc9 100644
--- a/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
+++ b/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
@@ -1088,7 +1088,7 @@ public class KafkaConsumer<K, V> implements Consumer<K, V>
{
     public void commitSync() {
         acquire();
         try {
-            commitSync(subscriptions.allConsumed());
+            coordinator.commitOffsetsSync(subscriptions.allConsumed(), Long.MAX_VALUE);
         } finally {
             release();
         }
@@ -1122,7 +1122,7 @@ public class KafkaConsumer<K, V> implements Consumer<K, V>
{
     public void commitSync(final Map<TopicPartition, OffsetAndMetadata> offsets) {
         acquire();
         try {
-            coordinator.commitOffsetsSync(offsets, Long.MAX_VALUE);
+            coordinator.commitOffsetsSync(new HashMap<>(offsets), Long.MAX_VALUE);
         } finally {
             release();
         }


Mime
View raw message