From f58f269c531b3da9fa7c2db2c9ae37765d11a913 Mon Sep 17 00:00:00 2001 From: Joel Koshy Date: Wed, 18 Feb 2015 17:28:34 -0800 Subject: [PATCH] Allow constructing explicitly versioned offset fetch request in javaapi --- core/src/main/scala/kafka/javaapi/OffsetFetchRequest.scala | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/kafka/javaapi/OffsetFetchRequest.scala b/core/src/main/scala/kafka/javaapi/OffsetFetchRequest.scala index 1c25aa3..afa675c 100644 --- a/core/src/main/scala/kafka/javaapi/OffsetFetchRequest.scala +++ b/core/src/main/scala/kafka/javaapi/OffsetFetchRequest.scala @@ -28,6 +28,14 @@ class OffsetFetchRequest(groupId: String, correlationId: Int, clientId: String) { + def this(groupId: String, + requestInfo: java.util.List[TopicAndPartition], + correlationId: Int, + clientId: String) { + // by default bind to version 0 so that it fetches from ZooKeeper + this(groupId, requestInfo, 0, correlationId, clientId) + } + val underlying = { val scalaSeq = { import JavaConversions._ @@ -36,7 +44,7 @@ class OffsetFetchRequest(groupId: String, kafka.api.OffsetFetchRequest( groupId = groupId, requestInfo = scalaSeq, - versionId = 0, // binds to version 0 so that it commits to Zookeeper + versionId = versionId, // binds to version 0 so that it commits to Zookeeper correlationId = correlationId, clientId = clientId ) -- 1.7.12.4