BrokerIdZNode Utility

BrokerIdZNode utility is used to decode or encode broker metadata for KafkaZkClient.

decode Utility

decode(
  id: Int,
  jsonBytes: Array[Byte]): BrokerInfo

decode…​FIXME

Note
decode is used when KafkaZkClient is requested to getAllBrokersInCluster, getAllBrokerAndEpochsInCluster, and getBroker.

encode Utility

encode(
  brokerInfo: BrokerInfo): Array[Byte] (1)
encode(
  version: Int,
  host: String,
  port: Int,
  advertisedEndpoints: Seq[EndPoint],
  jmxPort: Int,
  rack: Option[String]): Array[Byte]
  1. Uses the given BrokerInfo for the arguments of the other encode

encode…​FIXME

Note
encode is used when BrokerInfo is requested for a JSON representation (toJsonBytes) for KafkaZkClient to add and update a broker metadata in Zookeeper.

results matching ""

    No results matching ""