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权威指南
流式处理
187
式处理有一些特有的概念,对于那些有数据处理经验但是首次尝试开发流式处理应用程序
的人来说,很容易造成混淆。下面将试着澄清这些概念。
11.2.1
 时间
时间或许就是流式处理最为重要的概念,也是最让人感到困惑的。在讨论分布式系统时,
该如何理解复杂的时间概念?推荐阅读
Justin Sheehy
的论文“
There is No Now
”。在流式
处理里,时间是一个非常重要的概念,因为大部分流式应用的操作都是基于时间窗口的。
例如,流式应用可能会计算股价的
5
分钟移动平均数。如果生产者因为网络问题离线了
2
小时,然后带着
2
小时的数据重新连线,我们需要知道该如何处理这些数据。这些数据大
部分都已经超过了
5
分钟,而且没有参与之前的计算。
流式处理系统一般包含如下几个时间概念。
事件时间
事件时间是指所追踪事件的发生时间和记录的创建时间。例如,度量的获取时间、商店
里商品的出售时间、网站用户访问网页的时间,等等。在
Kafka 0.10.0
和更高版本里,
生产者会自动在记录中添加记录的创建时间。如果这个时间戳与应用程序对“事件时
间”的定义不一样,例如,
Kafka
的记录是基于事件发生后的数据库记录创建的,那就
需要自己设置这个时间戳字段。在处理数据流时,事件时间是很重要的。
日志追加时间
日志追加时间是指事件保存到
broker
的时间。在
Kafka 0.10.0
和更高版本里,如果启用
了自动添加时间戳的功能,或者记录是使用旧版本的生产者客户端生成的,而且没有包
含时间戳,那么
broker
会在接收这些记录时自动添加时间戳 ...
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