Pyspark shell initiates a Java gateway using Py4J then talk to it and send the python SparkContext to Java gateway.
However, How can I know which port Spark Context open? How could PySpark decide which port to use to create Java gateway Spark Context?
Additional question:
- Who start Py4j java process?