Last active
January 26, 2016 22:26
-
-
Save invkrh/54f3d795b2719f600bef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object AppConf { | |
| def main(args: Array[String]) { | |
| val sparkConf = new SparkConf() | |
| .setAppName(this.getClass.getName) | |
| val sc = new SparkContext(sparkConf) | |
| sc.makeRDD(1 to 20).map(x => { | |
| val conf = ConfigFactory.load() | |
| val host = conf.getString("settings.host") | |
| val port = conf.getInt("settings.port") | |
| val login = conf.getString("settings.login") | |
| login + "@" + host + ":" + (port + x) | |
| }).collect foreach println | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./bin/spark-submit \ | |
| --class AppConf \ | |
| --master local[*] \ | |
| --conf "spark.driver.extraJavaOptions=-Dsettings.port=8080 -Dsettings.login=hao" \ | |
| ~/workspace/scala/spark-typesafe-config/target/scala-2.10/spark-typesafe-config_2.10-1.0.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment