I've been using Apache Spark to write a desktop app which lets you tamper data interactively. I've recently started reading "Learning Spark" and in that the author says that in local mode (when master is set to local) Spark only uses one Thread.
How can I take advantage of all of the cores in my computer without having a full-blown Spark cluster on my computer?
I'm using Java / Kotlin.
It defaults to one, but you can specify how many you'd like like so:
val config = SparkConfig()
config.setMaster("local[8]") // local, using 8 threads (you can vary the number)
config.setAppName("qwerty")
val context = SparkContext(config)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With