Spark关键类

  • sparkEnv

    (D:\Spark\SourceCode\spark\core\src\main\scala\org\apache\spark\SparkEnv.scala)

Holds all the runtime environment objects for a running Spark instance (either master or worker), including the serializer, Akka actor system, block manager, map output tracker, etc. Currently Spark code finds the SparkEnv through a global variable, so all the threads can access the same SparkEnv. It can be accessed by SparkEnv.get (e.g. after creating a SparkContext).

  • Block manager

    (D:\Spark\SourceCode\spark\core\src\main\scala\org\apache\spark\storage\BlockManager.scala)

Manager running on every node (driver and executors) which provides interfaces for putting and retrieving blocks both locally and remotely into various stores (memory, disk, and off-heap).

Note that #initialize() must be called before the BlockManager is usable.

  • SparkConf

    (D:\Spark\SourceCode\spark\core\src\main\scala\org\apache\spark\SparkConf.scala)

  1. Configuration for a Spark application. Used to set various Spark parameters as key-value pairs.
  2. Most of the time, you would create a SparkConf object with `new SparkConf()`, which will load values from any `spark.*` Java system properties set in your application as well. In this case,parameters you set directly on the `SparkConf` object take priority over system properties.
  3. For unit tests, you can also call `new SparkConf(false)` to skip loading external settings and get the same configuration no matter what the system properties are.
  4. All setter methods in this class support chaining. For example, you can write `new SparkConf().setMaster("local").setAppName("My app")`.
  5. Note that once a SparkConf object is passed to Spark, it is cloned and can no longer be modified by the user. Spark does not support modifying the configuration at runtime.
  6. setMaster(): The master URL to connect to, such as "local" to run locally with one thread, "local[4]" to run locally with 4 cores, or "spark://master:7077" to run o``n a Spark standalone cluster.
  7. setAppName(): Set a name for your application. Shown in the Spark web UI
时间: 2024-10-20 07:38:39

Spark关键类的相关文章

Red5源代码分析 - 关键类及其初始化过程

原文地址:http://semi-sleep.javaeye.com/blog/348768 Red5如何响应rmpt的请求,中间涉及哪些关键类? 响应请求的流程如下: 1.Red5在启动时会调用RTMPMinaTransport的start()方法,该方法会开启rmtp的socket监听端口(默认是1935),然后使用mina(apache的io操作类库)的api将RTMPMinaIoHandler绑定到该端口. 2.RTMPMinaIoHandler上定义了messageReceived.m

Spark RDD类源码学习(未完)

每天进步一点点~开搞~ abstract class RDD[T: ClassTag]( //@transient 注解表示将字段标记为瞬态的 @transient private var _sc: SparkContext, // Seq是序列,元素有插入的先后顺序,可以有重复的元素. @transient private var deps: Seq[Dependency[_]] ) extends Serializable with Logging { if (classOf[RDD[_]]

Spark样本类与模式匹配

一.前言 样本类(case class)与模式匹配(pattern matching)是Scala中一个比较复杂的概念,往往让人感觉深陷泥沼.我在这里对Scala中的样本类与模式匹配进行了一些整理,希望让大家有些收获. 要学习样本类与模式匹配,先要理解这两个基本概念 .样本类是Scala提出的新概念,简单可以理解成希望用来做模式匹配的类加上case关键词就是样本类.模式匹配可以拆开来理解.这里模式不同于设计模式的模式,而是数据结构上的模式.这里的模式(pattern)是一个只包含变量. 有点类似

软件开发工程师(JAVA)中级考试大纲-----四(四)Log4J的原理及配置;Log4J常用的API;在项目中应用日志框架Log4J关键类和接口介绍;Java properties配置文件log

log4j Log4j是Apache的一个开放源代码项目,通过使用Log4j,我们可以控制日志信息输送的目的地是控制台.文件.GUI组件,甚至是套接口服务器.NT的事件记录器.UNIX Syslog守护进程等:我们也可以控制每一条日志的输出格式:通过定义每一条日志信息的级别,我们能够更加细致地控制日志的生成过程.最令人感兴趣的就是,这些可以通过一个配置文件来灵活地进行配置,而不需要修改应用的代码. 1定义 log4j--log for java(java的日志) 在强调可重用组件开发的今天,除了

spring cloud常用注解及关键类

[email protected] @SpringCloudApplication @EnableFeignClients @MapperScan("com.xx.common.domain.mapper") @ComponentScan({"com.xx.common", "com.xx.api"}) public class ApiApp { public static void main(String[] args) { SpringApp

Sqlite操作的一些关键类的官方说明与Intent的startactivityforresult方法

Intent: 该功能可以用于通过intent来跳转界面时候传递信号给原理的页面,以便做出一些处理: sqlite的使用: 该方法得到的sqlitedatabase可读可写,而getreadabledatabase是只读的: 继承sqliteopenhelper必须要实现的方法之一:sqliteopenhelper是一个抽象类,抽象类的抽象方法必须实现或者继续创建为抽象类继承该抽象类却不用实现具体的父类的抽象方法,接口默认都是抽象类与抽象方法. Baseadapter的使用说明: 所以一般的操作

spark reduce类操作

reduce类函数分析: ---------------------------------------------------------------------------- 待补全 ---------------------------------------------------------------------------- 要注意: 1.reduce先在各分区中做操作,随后进行整合. 2.reduce返回值类型和参加计算类型一样. 3.reduce过程不一定有shuffle的操作

《MonkeyRunner原理剖析》第九章-MonkeyImage实现原理 - 第一节 - 关键类作用及关系

作者 自主博客 微信 CSDN 天地会珠海分舵 http://techgogogo.com 服务号:TechGoGoGo 扫描码: http://blog.csdn.net/zhubaitian

Android 关键类(RefBase,sp, wp)

RefBase:含有内部类weakRef_Impl(影子对象),影子对象中有两个引用计数变量(强引用计数,弱引用计数) sp,构造的时候,强,弱引用计数均+1,析构的时候都-1 wp,构造的时候,弱引用+1,强引用不变,析构的时候弱引用-1,强引用不变 强引用计数=0:实际对象被delete 弱引用计数=0:影子对象被delete 延长对象生命: enum { OBJECT_LIFETIME_WEAK, OBJECT_LIFETIME_FOREVER }: OBJECT_LIFETIME_WEA