Spark:The Definitive Guide--读书小结(五)

Spark精要
本书全面介绍Spark2.0的API及生态系统,包括SparkSQL、StructStreaming、GraphX等,适合初学者快速入门。

前言

大概花了一个月(2020-09~2020-10)左右的时间,看完了整本书。笔者毕业后,主要从事机器学习、数据挖掘方向的相关工作。由于Spark作为目前主流的分布式计算引擎,个人也一直在用Spark进行相关的数据分析与建模工作。通读全书,感觉比较适合入门级学习,主要介绍了Spark 2.0相关API及Spark生态。涵盖Spark SQL、Struct Streaming、GraphX、MLlib等内容。对初学者而言是一本不错的书籍。

数据、源码链接: https://github.com/databricks/Spark-The-Definitive-Guide

第Ⅰ部分 大数据与Spark概述

链接: https://blog.youkuaiyun.com/Java_Man_China/article/details/109321946

第Ⅱ部分 结构化API–DataFrame、SQL和Dataset

链接: https://blog.youkuaiyun.com/Java_Man_China/article/details/109321946

第Ⅲ部分 低级API

链接: https://blog.youkuaiyun.com/Java_Man_China/article/details/109378254

第Ⅳ部分 生产与应用

链接: https://blog.youkuaiyun.com/Java_Man_China/article/details/109400672

第Ⅴ部分 流处理

waterMark 之 update模式
延迟的数据在一定的时间阈值范围内任然可被处理,一旦超过waterMark,该记录将不再被处理。streaming的输出模式主要有update、append、complete,waterMark对complete模式下的输出没有任何影响。因此下面结合update和append两种模式来阐述waterMark:(图片来自Spark官网)
在这里插入图片描述
update模式,在trigger发生时,会将当前的数据进行统计,并输出到result table,等到下一次trigger时,若发生之前存在延迟数据且在指定阈值范围内(waterMark),则将更新后的数据输出(此时只输出发生变化了的统计数据),同时根据水印的值,endTime小于水印的窗口(某窗口:startTime - endTime)所包含的记录将彻底的从内存中删除,这将保证内存永远够用。

update模式下采用socket得到的案例:
第一次水印:in(0) --> out(10:53)
第二次水印:in(10:53) —>out(10:58)
第三次水印:in(10:58) —>out(10:58) [水印不可能倒退]
在这里插入图片描述
第三次输入后,过期窗口的数据才从内存中删除。因为此时in(10:58) >第一次输入结果中的红色框(区间为前闭后开)
在这里插入图片描述

waterMark 之 append模式
在这里插入图片描述
Append模式下,若指定了水位(waterMark),则在trigger发生时,不会立即将结果输出到result table,会考虑当前的(waterMark > max event time - threshold)是否成立,若成立,则计算结果并输出,若不成立,则等到下一次trigger时,再次进行比较,直到满足条件时,输出结果。(个人理解是,waterMark + append模式下只输出过期了的数据,因为这些数据永远不会再发生变化)

在这里插入图片描述

在这里插入图片描述

第Ⅵ部分 高级分析与机器学习

链接: https://editor.youkuaiyun.com/md/?articleId=109321946//未写待续

第Ⅶ部分 生态系统

链接: https://editor.youkuaiyun.com/md/?articleId=109321946//未写待续

Work with all aspects of batch processing in a modern Java environment using a selection of Spring frameworks. This book provides up-to-date examples using the latest configuration techniques based on Java configuration and Spring Boot. The Definitive Guide to Spring Batch takes you from the “Hello, World!” of batch processing to complex scenarios demonstrating cloud native techniques for developing batch applications to be run on modern platforms. Finally this book demonstrates how you can use areas of the Spring portfolio beyond just Spring Batch 4 to collaboratively develop mission-critical batch processes. You’ll see how a new class of use cases and platforms has evolved to have an impact on batch-processing. Data science and big data have become prominent in modern IT and the use of batch processing to orchestrate workloads has become commonplace. The Definitive Guide to Spring Batch covers how running finite tasks on cloud infrastructure in a standardized way has changed where batch applications are run. Additionally, you’ll discover how Spring Batch 4 takes advantage of Java 9, Spring Framework 5, and the new Spring Boot 2 micro-framework. After reading this book, you’ll be able to use Spring Boot to simplify the development of your own Spring projects, as well as take advantage of Spring Cloud Task and Spring Cloud Data Flow for added cloud native functionality. Includes a foreword by Dave Syer, Spring Batch project founder. What You’ll Learn Discover what is new in Spring Batch 4 Carry out finite batch processing in the cloud using the Spring Batch project Understand the newest configuration techniques based on Java configuration and Spring Boot using practical examples Master batch processing in complex scenarios including in the cloud Develop batch applications to be run on modern platforms Use areas of the Spring portfolio beyond Spring Batch to develop mission-critical batch processes Who This Book Is For Experienced Java and Spring coders new to the Sp
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值