Github user JoshRosen commented on the pull request:
https://github.com/apache/spark/pull/2624#issuecomment-57722450
@davies:
> In the past, I remembered that we can have two different SparkEnv in the
same JVM, a different SparkEnv for executor to hold different TrackerClients.
Maybe it's not needed anymore.
`SparkEnv.create` is only called in two places, SparkContext and Executor's
constructors.
In Executor, we only create a new SparkContext if we're not running in
local mode:
```scala
// Initialize Spark environment (using system properties read above)
private val env = {
if (!isLocal) {
val _env = SparkEnv.create(conf, executorId, slaveHostname, 0,
isDriver = false, isLocal = false)
SparkEnv.set(_env)
_env.metricsSystem.registerSource(executorSource)
_env
} else {
SparkEnv.get
}
}
```
Since we only have one `Executor` instance per JVM, we only have one
SparkEnv per JVM (since we don't currently support concurrently-running
SparkContexts in the same JVM).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]