SparkContext - metadata
The SparkContext
object has a set of metadata that I found useful. The version number, application name, and memory available are useful pieces of information. At the start of a Spark program, I usually display/log the version number.
Value |
Use |
|
This value is the application name. If you have established a convention, this field can be useful at runtime. |
|
This value returns configuration information. |
|
This value retrieves memory details. It could be useful if you want to check memory details. As Spark is distributed, the values do not mean that you are out of memory. |
|
This value is the name of the master. |
|
I found this value very useful, especially while testing with different versions. |
Execute the following command from the shell:
cd ~/Downloads/spark-2.0.0 ( Or to wherever you have your spark installed) bin/spark-shell
Refer to the following screenshot:
scala> spark.version res0: String...