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:49:34 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.10.2 e321cd4f5 -> f4276b7cf


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

(cherry picked from commit b31a7a9022bfb645cb61e6fbc0b22829108b3a3f)
Signed-off-by: Jason Gustafson <jason@confluent.io>


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

Branch: refs/heads/0.10.2
Commit: f4276b7cfb2aefd61a937b7138094b936e6bceca
Parents: e321cd4
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:48:05 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/f4276b7c/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 ed3d607..d125e7e 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