

KafkaServerStartable 类启动Kafka Broker,startup方法负责启动Broker中各个组件,包括LogManager,KafkaRequestHandlers 。
AtomicBoolean 型变量 isStartingUp 初始化为 false,compareAndSet方法比较当前值是否为 false 并置为 true,可以认为是一个最简单的状态机。更新 brokerState: BrokerState 为 Starting。
initZkClient方法建立ZooKeeper连接,createTopLevelPaths方法在ZooKeeper中预建path,
ZooKeeperClient 鼓励请求 pipeline 处理。
connectionState: States 表示ZooKeeper连接状态,包括:CONNECTING, ASSOCIATING, CONNECTED, CONNECTEDREADONLY,CLOSED, AUTH_FAILED, NOT_CONNECTED。
handleRequest 方法发送请求并等待相应。
Stream




近期评论