源码解析|kafka源码解析Word版

免积分下载:http://download.csdn.net/detail/wl044090432/9487835
目录内容:

Kafka源码解析
目录
Kafka源码解析... 1
一.kafka诞生的背景... 2
1.1 kafka在LinkedIn内部的应用... 3
1.2 它的主要设计目标:... 3
1.3 为什么我们要使用消息系统:... 4
二.kafka内部的专业术语... 5
2.1 kafka的组成... 5
2.2 Kafka拓扑结构... 6
三.Broker. 7
3.1 Broker的启动... 7
3.2 Broker的模块组成... 10
3.3 Broker处理的request的来源... 11
3.4 SocketServer. 12
3.5 KafkaRequestHandlerPool16
【源码解析|kafka源码解析Word版】3.6 KafkaApis. 18
3.6.1 LogManager. 18
3.6.1.1 kafka日志的组成... 18
3.6.1.2 LogManager的启动... 21
3.6.2 ReplicaManager. 23
3.6.2.1 LeaderAndISRCommand处理流程... 24
3.6.2.2 StopReplicaCommand处理流程... 27
3.6.2.3 maybeShrinkIsr处理流程... 28
3.6.3 OffsetManager. 29
3.6.3.1 offsetsCache的更新机制... 29
3.6.3.2 compact机制... 30
3.6.4 KafkaApis. 31
3.6.4.1 RequestKeys.ProduceKey. 32
3.6.4.2 RequestKeys. FetchKey. 34
3.6.4.3 RequestKeys. OffsetsKey. 34
3.6.4.4 RequestKeys. MetadataKey. 35
3.6.4.5 RequestKeys. LeaderAndIsrKey. 36
3.6.4.6 RequestKeys. StopReplicaKey. 36
3.6.4.7 RequestKeys. UpdateMetadataKey. 36
3.6.4.8 RequestKeys. ControlledShutdownKey. 37
3.6.4.9 RequestKeys. OffsetCommitKey. 37
3.6.4.10 RequestKeys. OffsetFetchKey. 38
3.6.4.11 RequestKeys. ConsumerMetadataKey. 38
3.7 KafkaController. 39
3.7.1 KafkaController成为leader的过程... 39
3.7.2 kafkaController的初始化(leader)... 41
3.7.3 KafkaController PartitionStateMachine. 43
3.7.4 KafkaController PartitionLeaderSelector. 45
3.7.4.1 NoOpLeaderSelector. 45
3.7.4.2 OfflinePartitionLeaderSelector. 46
3.7.4.3 ReassignedPartitionLeaderSelector. 46
3.7.4.4 PreferredReplicaPartitionLeaderSelector. 47
3.7.4.5 ControlledShutdownLeaderSelector. 47
3.7.5 KafkaController ReplicaStateMachine. 48
3.7.6 KafkaController内部的listener. 51
3.7.6.1 brokerChangeListener. 51
3.7.6.2 topicChangeListener. 52
3.7.6.3 deleteTopicsListener. 53
3.7.6.4 preferredReplicaElectionListener. 53
3.7.6.5 partitionReassignedListener. 54
3.7.6.6 AddPartitionsListener. 57
3.7.7 KafkaController内部rebalance流程... 57
3.7.8 KafkaController内部topic删除流程TopicDeletionManager. 59
3.7.9 KafkaController(leader)和其它broker通信流程ControllerChannelManager. 60
3.8 KafkaHealthcheck. 61
3.9 TopicConfigManager. 62
四.客户端如何创建topic. 63
五.生成者流程(客户端如何向topic发送数据)65
六.消费者流程(客户端如何获取topic的数据)68
6.1 普通消费者... 68
6.2 高级消费者... 71

    推荐阅读