THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
As described earlier, the broker periodically sends out a heartbeat request to the active controller.
The listeners, features, and rack fields only need to be set when the broker is in INITIAL state, and is requesting a new broker epoch.
Code Block | ||
---|---|---|
| ||
{ "apiKey": 50, "type": "request", "name": "BrokerHeartbeatRequest", "validVersions": "0", "flexibleVersions": "0+", "fields": [ { "name": "CurrentState", "type": "int8", "versions": "0+", "about": "The current state that the broker is in." }, { "name": "TargetState", "type": "int8", "versions": "0+", "about": "The state that the broker wants to reach." }, { "name": "BrokerId", "type": "int32", "versions": "0+", "about": "The broker ID." }, { "name": "BrokerEpoch", "type": "int64", "versions": "0+", "default": "-1", "about": "The broker epoch, or -1 if one has not yet been assigned." }, { "name": "CurMetadataOffset", "type": "int64", "versions": "0+", "about": "The highest metadata offset which the broker has reached." }, { "name": "Listeners", "type": "[]Listener", "nullableVersions": "0+", "about": "The listeners of this broker", "versions": "0+", "fields": [ { "name": "Name", "type": "string", "versions": "0+", "mapKey": true, "about": "The name of the endpoint." }, { "name": "Host", "type": "string", "versions": "0+", "about": "The hostname." }, { "name": "Port", "type": "int16", "versions": "0+", "about": "The port." }, { "name": "SecurityProtocol", "type": "int16", "versions": "0+", "about": "The security protocol." } ] { "name": "Features", "type": "[]Feature", "nullableVersions": "0+", "about": "The features on this broker", "versions": "0+", "fields": [ { "name": "Name", "type": "string", "versions": "0+", "mapKey": true, "about": "The feature name." } { "name": "MinSupportedVersion", "type": "int16", "versions": "0+", "about": "The minimum supported feature level." }, { "name": "MaxSupportedVersion", "type": "int16", "versions": "0+", "about": "The maximum supported feature level." } ] }, { "name": "Rack", "type": "string", "versions": "0+", "nullableVersions": "0+", "about": "The rack which this broker is in." } ] } { "apiKey": 50, "type": "response", "name": "BrokerHeartbeatResponse", "validVersions": "0", "flexibleVersions": "0+", "fields": [ { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+", "about": "Duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." }, { "name": "ErrorCode", "type": "int16", "versions": "0+", "about": "The error code, or 0 if there was no error." }, { "name": "ActiveControllerId", "type": "int32", "versions": "0+", "about": "The ID of the active controller, or -1 if the controller doesn't know." }, { "name": "NextState", "type": "int8", "versions": "0+", "about": "The state to which the broker should transition." }, { "name": "BrokerEpoch", "type": "int64", "versions": "0+", "default": "-1", "about": "The broker's assigned epoch, or -1 if none was assigned." }, { "name": "LeaseDurationMs", "type": "int64", "versions": "0+", "about": "If BrokerEpoch is not -1, the number of milliseconds that we want the lease to last." } ] } enum BrokerState { UNKNOWN(0), INITIAL(1), FENCED(2), ACTIVE(3), SHUTDOWN(4); } |
...