计算机综合试验课件.ppt
《计算机综合试验课件.ppt》由会员分享,可在线阅读,更多相关《计算机综合试验课件.ppt(45页珍藏版)》请在三一办公上搜索。
1、计算机综合实验,Spark 简介,饶国政 博士 副教授http:/计算机科学与技术学院,2015年11月19日,入门介绍,什么是spark?,Apache Spark是一个围绕速度、易用性和复杂分析构建的大数据处理框架。最初在2009年由加州大学伯克利分校的AMP实验室开发,被标榜为“快如闪电的集群计算”,可用来构建大型的、低延迟的数据分析应用程序。它拥有一个繁荣的开源社区,并且是目前最活跃的Apache项目。,Spark Framework,SpeedRun programs up to 100 x faster than Hadoop MapReduce in memory,or 10 x
2、 faster on disk.2014年11月,Spark在Daytona Gray Sort 100TB Benchmark竞赛中打破了由Hadoop MapReduce保持的排序记录。Spark利用1/10的节点数,把100TB数据的排序时间从72分钟提高到了23分钟。Ease of UseWrite applications quickly in Java,Scala or Python.GeneralityCombine SQL,streaming,and complex analytics.Runs EverywhereSpark runs on Hadoop,Mesos,stan
3、dalone,or in the cloud.It can access diverse data sources including HDFS,Cassandra,HBase,S3.,Spark Framework,Project Components,Spark 1.5.2 released(Nov 9,2015),与MapReduce相比:Spark是基于内存并行大数据框架,中间结果存放到内存,对于迭代数据Spark效率高。Spark可以避免不必要的排序所带来的开销支持比Map和Reduce更多的函数。,Spark提供了一个更快、更通用的数据处理平台。和Hadoop相比,Spark可以让
4、你的程序在内存中运行时速度提升100倍,或者在磁盘上运行时速度提升10倍。在100 TB Daytona GraySort比赛中,Spark战胜了Hadoop,它只使用了十分之一的机器,但运行速度提升了3倍。,其他优化任意操作算子图(operatorgraphs)可以帮助优化整体数据处理流程的大数据查询的延迟计算。提供简明、一致的Scala,Java和PythonAPI。提供交互式Scala和PythonShell。,Spark生态圈,Spark Framework,Apache Sparkan open-source cluster computing framework originall
5、y developed in the AMPLab at UC BerkeleyIn contrast to Hadoops two-stage disk-based MapReduce paradigm,Sparks in-memory primitives provide performance up to 100 times faster for certain applicationsBy allowing user programs to load data into a clusters memory and query it repeatedly,Spark is well su
6、ited to machine learning algorithmsSpark can interface with a wide variety of file or storage systems,including Hadoop Distributed File System(HDFS),Cassandra,OpenStack Swift,or Amazon S3.In February 2014,Spark became an Apache Top-Level Project.,Spark Framework,Project ComponentsSpark Core and Resi
7、lient Distributed Datasets(RDDs)The fundamental programming abstraction is called Resilient Distributed Datasets,a logical collection of data partitioned across machines.RDDs can be created by referencing datasets in external storage systems,or by applying coarse-grained transformations(e.g.map,filt
8、er,reduce,join)on existing RDDs.The RDD abstraction is exposed through a language-integrated API in Java,Python,Scala similar to local,in-process collections.This simplifies programming complexity because the way applications manipulate RDDs is similar to manipulating local collections of data.,Spar
9、k Core,包含Spark的基本功能;尤其是定义RDD的API、操作以及这两者上的动作。其他Spark的库都是构建在RDD和Spark Core之上的。,RDD介绍,RDD(Resilient Distributed Datasets弹性分布式数据集),是一个只读、分区记录的集合,是spark中最重要的概念,可以把他理解为一个存储数据的数据结构!在Spark中一切基于RDD。用户可以简单的把RDD理解成一个提供了许多操作接口的数据集合,和一般数据集不同的是,其实际数据分布存储于一批机器中(内存或磁盘中)。它的功能还包括容错、集合内的数据可以并行处理等。,RDD是Spark中对数据和计算的抽象
10、,是Spark中最核心的概念,它表示已被分片/划分(partition),不可变的并能够被并行操作的数据集合。对RDD的操作分为两种transformation和action。Transformation操作是通过转换从一个或多个RDD生成新的RDD。Action操作是从RDD生成最后的计算结果。在Spark最新的版本中,提供丰富的transformation和action操作,比起MapReduce计算模型中仅有的两种操作,会大大简化程序开发的难度。RDD的生成方式只有两种,一是从数据源读入,另一种就是从其它RDD通过transformation操作转换。一个典型的Spark程序就是通过Sp
11、ark上下文环境(SparkContext)生成一个或多个RDD,在这些RDD上通过一系列的transformation操作生成最终的RDD,最后通过调用最终RDD的action方法输出结果。,每个RDD都可以用下面5个特性来表示,其中后两个为可选的:分片列表(数据块列表)计算每个分片的函数对父RDD的依赖列表对key-value类型的RDD的分片器(Partitioner)(可选)每个数据分片的预定义地址列表(如HDFS上的数据块的地址)(可选),Spark Framework,Project ComponentsSpark SQLSpark SQL is a component on to
12、p of Spark Core that introduces a new data abstraction called SchemaRDD,which provides support for structured and semi-structured data.Spark SQL provides a domain-specific language to manipulate SchemaRDDs in Scala,Java,or Python.It also provides SQL language support,with command-line interfaces and
13、 ODBC/JDBC server.,Spark SQL:提供通过Apache Hive的SQL变体Hive查询语言(HiveQL)与Spark进行交互的API。每个数据库表被当做一个RDD,Spark SQL查询被转换为Spark操作。对熟悉Hive和HiveQL的人,Spark可以拿来就用。,Spark Framework,Project ComponentsSpark StreamingSpark Streaming leverages Spark Cores fast scheduling capability to perform streaming analytics.It ing
14、ests data in mini-batches and performs RDD transformations on those mini-batches of data.This design enables the same set of application code written for batch analytics to be used in streaming analytics,on a single engine.,Spark Streaming:允许对实时数据流进行处理和控制。很多实时数据库(如Apache Store)可以处理实时数据。Spark Streami
15、ng允许程序能够像普通RDD一样处理实时数据。,Spark Framework,Project ComponentsMLlib Machine Learning LibraryMLlib is a distributed machine learning framework on top of Spark that because of the distributed memory-based Spark architecture is ten times as fast as Hadoop disk-based Apache Mahout,MLlib:一个常用机器学习算法库,算法被实现为对R
16、DD的Spark操作。这个库包含可扩展的学习算法,比如分类、回归等需要对大量数据集进行迭代的操作。之前可选的大数据机器学习库Mahout,将会转到Spark,并在未来实现。,Spark Framework,Project ComponentsGraphXGraphX is a distributed graph processing framework on top of Spark.It provides an API for expressing graph computation that can model the Pregel abstraction.GraphX:控制图、并行图操作
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机 综合 试验 课件
![提示](https://www.31ppt.com/images/bang_tan.gif)
链接地址:https://www.31ppt.com/p-3967625.html