Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-6074 Use ZookeeperClient in ReplicaManager and Partition #4124

Closed
wants to merge 4 commits into from
Closed

KAFKA-6074 Use ZookeeperClient in ReplicaManager and Partition #4124

wants to merge 4 commits into from

Conversation

tedyu
Copy link
Contributor

@tedyu tedyu commented Oct 24, 2017

No description provided.

@tedyu
Copy link
Contributor Author

tedyu commented Oct 24, 2017

In zkUtils.conditionalUpdatePersistentPath():

      val stat = zkClientWrap(_.writeDataReturnStat(path, data, expectVersion))

Currently there is no writeData in KafkaControllerZkUtils.
Planning to add it.

See if what I have so far is on right track.

@tedyu
Copy link
Contributor Author

tedyu commented Oct 24, 2017

More compilation errors to tackle:

https://pastebin.com/rK0FwQBJ

@omkreddy
Copy link
Contributor

omkreddy commented Oct 24, 2017

@tedyu I also ported the conditionalUpdatePersistentPath method in my #4126 PR. Pl check if we can reuse that code .

@@ -361,6 +365,7 @@ sealed trait AsyncResponse {
}
case class CreateResponse(resultCode: Code, path: String, ctx: Option[Any], name: String) extends AsyncResponse
case class DeleteResponse(resultCode: Code, path: String, ctx: Option[Any]) extends AsyncResponse
case class WriteDataReturnStatResponse(resultCode: Code, path: String, ctx: Option[Any], stat: Stat) extends AsyncResponse
Copy link
Contributor

@omkreddy omkreddy Oct 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use SetDataResponse for writing right? Pls check #4126

@onurkaraman
Copy link
Contributor

Just a heads up: I consciously avoided copying existing util methods from ZkUtils over to KafkaControllerZkUtils.

@tedyu
Copy link
Contributor Author

tedyu commented Oct 24, 2017

I will wait till #4126 gets merged (for code reuse)

Copy link
Contributor

@junrao junrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tedyu : Thanks for the patch. A couple of comments below.

def createSequentialPersistentPath(path: String, data: String = ""): String = {
val createRequest = CreateRequest(path, data.getBytes("UTF-8"), acls(path), CreateMode.PERSISTENT_SEQUENTIAL)
val createResponse = retryRequestUntilConnected(createRequest)
createResponse.path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to throw an exception if the rc in createResponse is not Code.OK.

@@ -98,6 +100,11 @@ class KafkaControllerZkUtils(zookeeperClient: ZookeeperClient, isSecure: Boolean
retryRequestUntilConnected(createRequest)
}

def leaderAndIsrZkData(leaderAndIsr: LeaderAndIsr, controllerEpoch: Int): String = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably should be in ZkData.scala.

@tedyu
Copy link
Contributor Author

tedyu commented Oct 25, 2017

Thanks for the review, Jun.

Planning to rebase once #4126 goes in.

@ijuma
Copy link
Contributor

ijuma commented Dec 28, 2017

This was superseded by #4254

@ijuma ijuma closed this Dec 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants