Skip to Content
Kafka权威指南
book

Kafka权威指南

by Neha Narkhede, Gwen Shapira, Todd Palino
January 2018
Beginner to intermediate
234 pages
7h 8m
Chinese
Posts & Telecom Press
Content preview from Kafka权威指南
流式处理
203
输入主题:
拆分成单词
=单词 过滤掉“the”
按照键分组
重分区主题
计数器
输出主题:
单词数量
本地
状态
11-10:字数统计示例的拓扑结构
哪怕是一个很简单的应用,都需要一个拓扑。拓扑是由处理器组成的,这些处理器是拓扑
图里的节点(用椭圆表示)。大部分处理器都实现了一个数据操作——过滤、映射、聚合
等。数据源处理器从主题上读取数据,并传给其他组件,而数据池处理器从上一个处理器
接收数据,并将它们生成到主题上。拓扑总是从一个或多个数据源处理器开始,并以一个
或多个数据池处理器结束。
11.5.2
 对拓扑进行伸缩
Streams
通过在单个实例里运行多个线程和在分布式应用实例间进行负载均衡来实现伸缩。
用户可以在一台机器上运行
Streams
应用,并开启多个线程,也可以在多台机器上运行
Streams
应用。不管采用何种方式,所有的活动线程将会均衡地处理工作负载。
Streams
引擎将拓扑拆分成多个子任务来并行执行。拆分成多少个任务取决于
Streams
擎,同时也取决于主题的分区数量。每个任务负责一些分区:任务会订阅这些分区,并
从分区读取事件数据,在将结果写到数据池之前,在每个事件上执行所有的处理步骤。
这些任务是
Streams
引擎最基本的并行单元,因为每个任务可以彼此独立地执行,如图
11-11
所示。
主题
分区1
分区2
任务1
任务2
输出主题
11-11:运行相同拓扑的两个任务——每个读取主题的一个分区
204
11
开发人员可以选择每个应用程序使用的线程数。如果使用了多个线程,每个线程将会执行 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

精通機器學習

精通機器學習

Aurélien Géron
精通特征工程

精通特征工程

Alice Zheng, Amanda Casari
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald

Publisher Resources

ISBN: 9787115473271