Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,8 @@ private[spark] object PythonUtils {
def toScalaMap[K, V](jm: java.util.Map[K, V]): Map[K, V] = {
jm.asScala.toMap
}

def getEncryptionEnabled(sc: JavaSparkContext): Boolean = {
sc.conf.get(org.apache.spark.internal.config.IO_ENCRYPTION_ENABLED)
}
}
4 changes: 1 addition & 3 deletions python/pyspark/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ def _do_init(self, master, appName, sparkHome, pyFiles, environment, batchSize,
# If encryption is enabled, we need to setup a server in the jvm to read broadcast
# data via a socket.
# scala's mangled names w/ $ in them require special treatment.
encryption_conf = self._jvm.org.apache.spark.internal.config.__getattr__("package$")\
.__getattr__("MODULE$").IO_ENCRYPTION_ENABLED()
self._encryption_enabled = self._jsc.sc().conf().get(encryption_conf)
self._encryption_enabled = self._jvm.PythonUtils.getEncryptionEnabled(self._jsc)

self.pythonExec = os.environ.get("PYSPARK_PYTHON", 'python')
self.pythonVer = "%d.%d" % sys.version_info[:2]
Expand Down