Complete the code to create a Kafka controller broker ID.
controller_id = [1]The controller broker ID is set to -1 initially before election.
Complete the code to check if the current broker is the controller.
is_controller = (broker_id [1] controller_id)We check if the broker ID equals the controller ID to confirm controller status.
Fix the error in the code to elect a new controller broker.
new_controller = min([1])
The election picks the broker with the smallest ID from the list of broker IDs.
Fill both blanks to create a dictionary of brokers with their controller status.
controller_status = {broker: (broker [1] controller_id) for broker in [2]The dictionary comprehension maps each broker ID to True if it is the controller, else False.
Fill all three blanks to update the controller broker and notify all brokers.
controller_id = [1] for broker in [2]: notify(broker, [3])
We assign the new controller ID, then notify all brokers with a 'controller_changed' message.
