You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "cmccabe (via GitHub)" <gi...@apache.org> on 2023/09/01 18:05:10 UTC
[GitHub] [kafka] cmccabe commented on a diff in pull request #14306: KAFKA-15369: Implement KIP-919: Allow AC to Talk Directly with Controllers
cmccabe commented on code in PR #14306:
URL: https://github.com/apache/kafka/pull/14306#discussion_r1313363156
##########
core/src/main/scala/kafka/server/AuthHelper.scala:
##########
@@ -130,4 +134,57 @@ class AuthHelper(authorizer: Option[Authorizer]) {
}
}
+ def computeDescribeClusterResponse(
+ request: RequestChannel.Request,
+ expectedEndpointType: EndpointType,
+ clusterId: String,
+ getNodes: () => DescribeClusterBrokerCollection,
+ getControllerId: () => Int
+ ): DescribeClusterResponseData = {
+ val describeClusterRequest = request.body[DescribeClusterRequest]
+ val requestEndpointType = EndpointType.fromId(describeClusterRequest.data().endpointType())
+ if (requestEndpointType.equals(EndpointType.UNKNOWN)) {
+ return new DescribeClusterResponseData().
+ setErrorCode(if (request.header.data().requestApiVersion() == 0) {
+ Errors.INVALID_REQUEST.code()
+ } else {
+ Errors.UNSUPPORTED_ENDPOINT_TYPE.code()
+ }).
+ setErrorMessage("Unsupported endpoint type " + describeClusterRequest.data().endpointType().toInt)
+ } else if (!expectedEndpointType.equals(requestEndpointType)) {
+ return new DescribeClusterResponseData().
+ setErrorCode(if (request.header.data().requestApiVersion() == 0) {
+ Errors.INVALID_REQUEST.code()
+ } else {
+ Errors.MISMATCHED_ENDPOINT_TYPE.code()
+ }).
+ setErrorMessage("The request was sent to an endpoint of type " + expectedEndpointType +
+ ", but we wanted an endpoint of type " + requestEndpointType)
+ }
Review Comment:
v0 of the schema has no place to put endpoint type. it simply cannot be serialized in the v0 encoding. doesn't matter what client or programming language you use.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org