http://spark.apache.org/docs/latest/rdd-programming-guide.html

The first thing a Spark program must do is to create a SparkContext object, which tells Spark how to access a cluster. To create a SparkContext you first need to build a SparkConf object that contains information about your application.

Only one SparkContext may be active per JVM. You must stop() the active SparkContext before creating a new one.

SparkConf:

Configuration for a Spark application. Used to set various Spark parameters as key-value pairs.

All setter methods in this class support chaining. For example, you can write

new SparkConf().setMaster("local").setAppName("My app").

The appName parameter is a name for your application to show on the cluster UI. master is a Spark, Mesos or YARN cluster URL, or a special “local” string to run in local mode. In practice, when running on a cluster, you will not want to hardcode master in the program, but rather launch the application with spark-submit and receive it there. However, for local testing and unit tests, you can pass “local” to run Spark in-process.

sparkcontext 和 sparkconf的更多相关文章

  1. spark 笔记 5: SparkContext,SparkConf

    SparkContext 是spark的程序入口,相当于熟悉的'main'函数.它负责链接spark集群.创建RDD.创建累加计数器.创建广播变量. ) scheduler.initialize(ba ...

  2. SparkConf加载与SparkContext创建(源码阅读一)

    即日起开始spark源码阅读之旅,这个过程是相当痛苦的,也许有大量的看不懂,但是每天一个方法,一点点看,相信总归会有极大地提高的.那么下面开始: 创建sparkConf对象,那么究竟它干了什么了类,从 ...

  3. SparkContext源码阅读

    SparkContext是spark的入口,通过它来连接集群.创建RDD.广播变量等等. class SparkContext(config: SparkConf) extends Logging w ...

  4. SparkContext和RDD

    SparkContext.scala实现了一个SparkContext的class和object,SparkContext类似Spark的入口,负责连接Spark集群,创建RDD,累积量和广播量等. ...

  5. SparkContext自定义扩展textFiles,支持从多个目录中输入文本文件

    需求   SparkContext自定义扩展textFiles,支持从多个目录中输入文本文件   扩展   class SparkContext(pyspark.SparkContext): def ...

  6. Spark 核心篇-SparkContext

    本章内容: 1.功能描述 本篇文章就要根据源码分析SparkContext所做的一些事情,用过Spark的开发者都知道SparkContext是编写Spark程序用到的第一个类,足以说明SparkCo ...

  7. spark[源码]-sparkContext概述

    SparkContext概述 sparkContext是所有的spark应用程序的发动机引擎,就是说你想要运行spark程序就必须创建一个,不然就没的玩了.sparkContext负责初始化很多东西, ...

  8. Spark-源码-SparkContext的初始化

    Spark版本 1.3SparkContext初始化流程 1.0 在我们的主类 main() 方法中经常会这么写 val conf = new SparkConf().setAppName(" ...

  9. 《深入理解Spark-核心思想与源码分析》(三)第三章SparkContext的初始化

    3.1 SparkContext概述 SparkConf负责配置参数,主要通过ConcurrentHaspMap来维护各种Spark的配置属性. class SparkConf(loadDefault ...

随机推荐

  1. ES6必知必会 (二)—— 字符串和函数的拓展

    字符串的拓展 1.ES6为字符串添加了遍历器接口,因此可以使用for...of循环遍历字符串 2.字符串新增的 includes().startsWith().endsWidth() 三个方法用于判断 ...

  2. Cocos2d-X数据、动作、消息的基本操作

    加入类的create方法: CREATE_FUNC(ClassName) 使用这个宏能够为类加入一个create方法. 创建类的对象时一律用Class::create()的形式. 在CREATE_FU ...

  3. windows 安装操作系统时切换分区表格式

    在出现分区管理界面时,按下shift+F10呼出命令行,输入diskpart 后尝试如下命令将磁盘分区表手动转换到MBR. list disk ---- 显示当前磁盘列表 select disk x ...

  4. Apache mod_rewrite实现HTTP和HTTPS重定向跳转

    当你的站点使用了HTTPS之后,你可能会想把所有的HTTP请求(即端口80的请求),全部都重定向至HTTPS(即端口443).这时候你可以用以下的方式来做到:(Apache mod_rewrite) ...

  5. 【python】网络编程-TCP协议套接字

    服务器端: #!/usr/bin/env python from socket import * from time import ctime HOST = '' PORT = 21567 BUFSI ...

  6. mysql 按照 where in 排序

    select * from user_extend where `unique` in('mark.liu@xxxx.com','jason.gan@xxxx.com','ssgao@xxxx.com ...

  7. RabbitMQ 主题

    RabbitMQ (三) 发布/订阅 RabbitMQ主题 RabbitMQ Tutorials

  8. 小甲鱼-003 python插曲值变量和字符串

    变量名就像现实生活人们的名字,把一个值赋值给一个名字时,他会存储在内存中,称之为变量variable,在大多数语言中,都把这种行为成为"给变量赋值"或"把值存储在变量中& ...

  9. 阿里云内网和公网NTP服务器和其他互联网基础服务时间同步服务器

    阿里云为云服务器ECS提供了内网NTP服务器,对于阿里云以外的设备,阿里云同时提供了 公网NTP服务器,供互联网上的设备使用. 内网和公网NTP服务器 以下为阿里云提供的内网和公网NTP服务器列表. ...

  10. (转!)大话websocket

    邪正看眼鼻,真假看嘴唇,功名看气概,富贵看精神. ---曾国藩<冰鉴> 转自https://www.cnblogs.com/fuqiang88/p/5956363.html 原文http: ...