kevin-wu24 commented on code in PR #22191:
URL: https://github.com/apache/kafka/pull/22191#discussion_r3336229586
##########
metadata/src/main/java/org/apache/kafka/controller/ClusterControlManager.java:
##########
@@ -498,6 +500,22 @@ ControllerResult<Void>
registerController(ControllerRegistrationRequestData requ
return ControllerResult.atomicOf(records, null);
}
+ ControllerResult<Void> unregisterController(int controllerId) {
+ if
(!featureControl.metadataVersionOrThrow().isControllerUnregistrationSupported())
{
+ throw new UnsupportedVersionException("The current MetadataVersion
is too old to " +
+ "support controller unregistration.");
+ }
+ if (controllerRegistrations.get(controllerId) == null) {
+ throw new ControllerIdNotRegisteredException("Controller ID " +
controllerId +
+ " is not currently registered.");
+ }
+ List<ApiMessageAndVersion> records = new ArrayList<>();
+ records.add(new ApiMessageAndVersion(new UnregisterControllerRecord().
+ setControllerId(controllerId),
+ (short) 0));
Review Comment:
I followed the indentation for `registerController` above.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]