Write familiar with the first sentence of the Code
val conf = new SparkConf (). setAppName ( "WordCount")
Click SparkConf (), find
private val settings = new ConcurrentHashMap[String, String]()
All configurations are visible to map [String, String] defined
// i.e. loadDefaults to true ==
DEF the this () = the this ( to true)
//
IF(loadDefaults) {
// loading system default configuration loadFromSystemProperties (to false) } Private[Spark] DEF loadFromSystemProperties (Silent: Boolean): SparkConf ={ / /. the any spark * the load system propertiesloads all spark * at the beginning of system attributes for((Key, value) <- Utils.getSystemPropertiesIFkey.startsWith ("Spark.")) { SET(Key, value, Silent) } the this } / ** the Set Configuration A variable.* / Set attributes themselves DEF SET (Key: String, value: String): SparkConf = { SET (Key, value, to false ) }
// the code at the beginning of a call that is written in the method, which in turn calls the set method, to complete the configuration
DEF setAppName (name: String): = {SparkConf
set ( "spark.app.name", name)
}