Skip to content

Instantly share code, notes, and snippets.

@invkrh
Last active January 26, 2016 22:26
Show Gist options
  • Save invkrh/54f3d795b2719f600bef to your computer and use it in GitHub Desktop.
Save invkrh/54f3d795b2719f600bef to your computer and use it in GitHub Desktop.
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
}
}
./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