You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by jj...@apache.org on 2015/02/19 03:02:00 UTC

kafka git commit: KAFKA-1729; (followup patch)Add constructor to javaapi to allow constructing explicitly versioned offset fetch requests; reviewed by Jun Rao

Repository: kafka
Updated Branches:
  refs/heads/trunk f7f8ac1a8 -> 4c8817e3d


KAFKA-1729; (followup patch)Add constructor to javaapi to allow
constructing explicitly versioned offset fetch requests; reviewed by Jun Rao


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

Branch: refs/heads/trunk
Commit: 4c8817e3d156416240906dd06a4494386949ba0a
Parents: f7f8ac1
Author: Joel Koshy <jj...@gmail.com>
Authored: Wed Feb 18 17:53:45 2015 -0800
Committer: Joel Koshy <jj...@gmail.com>
Committed: Wed Feb 18 18:01:15 2015 -0800

----------------------------------------------------------------------
 .../src/main/scala/kafka/javaapi/OffsetFetchRequest.scala | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/4c8817e3/core/src/main/scala/kafka/javaapi/OffsetFetchRequest.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/javaapi/OffsetFetchRequest.scala b/core/src/main/scala/kafka/javaapi/OffsetFetchRequest.scala
index 1c25aa3..818ae33 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,
       correlationId = correlationId,
       clientId = clientId
     )