Browse Source

KAFKA-1729; (followup patch)Add constructor to javaapi to allow

constructing explicitly versioned offset fetch requests; reviewed by Jun Rao
pull/1442/head
Joel Koshy 10 years ago
parent
commit
4c8817e3d1
  1. 10
      core/src/main/scala/kafka/javaapi/OffsetFetchRequest.scala

10
core/src/main/scala/kafka/javaapi/OffsetFetchRequest.scala

@ -28,6 +28,14 @@ class OffsetFetchRequest(groupId: String, @@ -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, @@ -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
)

Loading…
Cancel
Save