kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-3075; Fix ClassCastException in `ZookeeperConsumerConnector.commitOffsets`
Date Fri, 29 Jan 2016 16:53:00 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.9.0 1a12d1333 -> b08bd1679


KAFKA-3075; Fix ClassCastException in `ZookeeperConsumerConnector.commitOffsets`

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Guozhang Wang

Closes #833 from ijuma/kafka-3075-javaapi-consumer-class-cast-exception

(cherry picked from commit 20afdcdd2ec129e94cbf335555c3d78f19a2d58e)
Signed-off-by: Guozhang Wang <wangguoz@gmail.com>


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

Branch: refs/heads/0.9.0
Commit: b08bd167965ae7307687fdb6115136a6ce14b3fa
Parents: 1a12d13
Author: Ismael Juma <ismael@juma.me.uk>
Authored: Fri Jan 29 08:52:50 2016 -0800
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Fri Jan 29 08:52:57 2016 -0800

----------------------------------------------------------------------
 .../scala/kafka/javaapi/consumer/ZookeeperConsumerConnector.scala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/b08bd167/core/src/main/scala/kafka/javaapi/consumer/ZookeeperConsumerConnector.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/javaapi/consumer/ZookeeperConsumerConnector.scala b/core/src/main/scala/kafka/javaapi/consumer/ZookeeperConsumerConnector.scala
index bfd8d37..6347bfd 100644
--- a/core/src/main/scala/kafka/javaapi/consumer/ZookeeperConsumerConnector.scala
+++ b/core/src/main/scala/kafka/javaapi/consumer/ZookeeperConsumerConnector.scala
@@ -21,6 +21,7 @@ import kafka.consumer._
 import kafka.common.{OffsetAndMetadata, TopicAndPartition, MessageStreamsExistException}
 import scala.collection.{immutable, mutable, JavaConversions}
 import java.util.concurrent.atomic.AtomicBoolean
+import scala.collection.JavaConverters._
 
 /**
  * This class handles the consumers interaction with zookeeper
@@ -115,7 +116,7 @@ private[kafka] class ZookeeperConsumerConnector(val config: ConsumerConfig,
   }
 
   def commitOffsets(offsetsToCommit: java.util.Map[TopicAndPartition, OffsetAndMetadata],
retryOnFailure: Boolean) {
-    underlying.commitOffsets(offsetsToCommit.asInstanceOf[immutable.Map[TopicAndPartition,
OffsetAndMetadata]], retryOnFailure)
+    underlying.commitOffsets(offsetsToCommit.asScala.toMap, retryOnFailure)
   }
 
   def setConsumerRebalanceListener(consumerRebalanceListener: ConsumerRebalanceListener)
{


Mime
View raw message