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,
correlationId: Int, correlationId: Int,
clientId: String) { 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 underlying = {
val scalaSeq = { val scalaSeq = {
import JavaConversions._ import JavaConversions._
@ -36,7 +44,7 @@ class OffsetFetchRequest(groupId: String,
kafka.api.OffsetFetchRequest( kafka.api.OffsetFetchRequest(
groupId = groupId, groupId = groupId,
requestInfo = scalaSeq, requestInfo = scalaSeq,
versionId = 0, // binds to version 0 so that it commits to Zookeeper versionId = versionId,
correlationId = correlationId, correlationId = correlationId,
clientId = clientId clientId = clientId
) )

Loading…
Cancel
Save