当前位置:网站首页>Spark的原理解析
Spark的原理解析
2022-07-02 06:24:00 【无聊的n一天】
Spark的原理解析
文章目录
前言
今天主要学习的是一个Spark框架的原理解析,spark的运行流程,RDD的一个执行过程,依赖关系的一个介绍
一. Spark简介
Spark是由scala开发的,scala运行于JAVA平台(JVM),并兼容现有的JAVA程序,所以使用scala编写的程序由Java jdk就能运行,并不需要scala jdk
Spark与MapReduce对比

由上图可以看出,使用Hadoop MR进行迭代计算非常耗资源
Spark将数据载入内存后,之后的迭代计算都可以直接使用内存中的中间结果作运算,避免了从磁盘中频繁读取数据
二.基本概念和架构设计

Spark运行的基本流程(这里以YARN为例)

- 客户端提交应用程序的时候,首先为应用构起基本运行环境SparkContext并向RM注册并申请资源,即由Driver创建一个SC进行资源的申请,任务的分配和监控
这里的Driver理解为用户编写的应用程序,SparkContex(SC)t就类似RM中的AM功能 - RM收到请求后会启动Executor并分配资源,并向SC注册并申请Task,并时刻与SC保持通信防止断联。
- 待作业运行完后SC向RM申请注销并关闭自己
RDD的一个基本运行概述
RDD的典型执行过程如下

1.RDD读入外部数据源并创建,如果数据源大就会创建多个分区,不同的分区就会到不同的数据节点上,就是因为这一特性,才叫RDD:分布式弹性数据集
2.RDD经过一系列的转换操作:每一次转换操作都会形成新的RDD供下一个转换操作使用,这样串起来就构成了DAG图
3.最后一个RDD经过动作操作输出到外部数据源
处理过程中,RDD都会转换,但不会具体的生成结果,只有遇到动作操作(action)才会去计算相应的结果

RDD的依赖关系
如上图所示,RDD的依赖关系分为宽依赖和窄依赖,什么有窄依赖,下面我说一下宽依赖,表现为存在一个父RDD的一个分区对应一个子RDD的多个分区
总结
今天写的比较水,总的来说就是为了巩固今天的所学而写的。后面有时间了还会再具体一点
边栏推荐
- After reading useful blogs
- Sublime text configuring PHP compilation environment
- Eggjs -typeorm treeenity practice
- [literature reading and thought notes 13] unprocessing images for learned raw denoising
- Win10: add or delete boot items, and add user-defined boot files to boot items
- DeprecationWarning: . ix is deprecated. Please use. loc for label based indexing or. iloc for positi
- Use of interrupt()
- Explanation and application of annotation and reflection
- 微信小程序基础
- Usage of map and foreach in JS
猜你喜欢
![[Zhang San learns C language] - deeply understand data storage](/img/b5/cf0bfae8eacf335d3c350c9cbadb87.png)
[Zhang San learns C language] - deeply understand data storage

The default Google browser cannot open the link (clicking the hyperlink does not respond)

Sqli labs customs clearance summary-page3

CSRF攻击

Présence d'une panne de courant anormale; Problème de gestion de la fsck d'exécution résolu

js中map和forEach的用法

sqli-labs通关汇总-page1

Implement strstr() II

Build learning tensorflow

In depth study of JVM bottom layer (V): class loading mechanism
随机推荐
sqli-labs通关汇总-page4
在php的开发环境中如何调取WebService?
Promise中有resolve和无resolve的代码执行顺序
AWD learning
SQLI-LABS通关(less15-less17)
Nodejs - Express middleware modification header: typeerror [err_invalid_char]: invalid character in header content
ModuleNotFoundError: No module named ‘jieba. analyse‘; ‘ jieba‘ is not a package
sqli-labs通关汇总-page2
[literature reading and thought notes 13] unprocessing images for learned raw denoising
JS delete the last bit of the string
MySQL index
Self study table Au
CAD secondary development object
SQLI-LABS通关(less18-less20)
UEditor .Net版本任意文件上传漏洞复现
php中通过集合collect的方法来实现把某个值插入到数组中指定的位置
默认google浏览器打不开链接(点击超链接没有反应)
How to debug wechat built-in browser applications (enterprise number, official account, subscription number)
CAD二次开发 对象
VSCODE 安装LATEX环境,参数配置,常见问题解决