Skip to content

Instantly share code, notes, and snippets.

@danared
Created June 24, 2016 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danared/033ce73fa54f2d3cf8a8ee7c851aaf11 to your computer and use it in GitHub Desktop.
Save danared/033ce73fa54f2d3cf8a8ee7c851aaf11 to your computer and use it in GitHub Desktop.
/**
* Gets or creates the Spark Context
*/
def getSparkContext(): SparkContext = {
val conf = new SparkConf()
.setMaster("local[*]")
.setAppName("MovieRatings")
val sc = SparkContext.getOrCreate(conf)
sc.setCheckpointDir("/tmp/checkpoint/")
sc
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment