Skip to content

Commit ba77ca4

Browse files
committed
remove getThreadLocal(), update docs
1 parent ee62bb7 commit ba77ca4

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

core/src/main/scala/org/apache/spark/SparkEnv.scala

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ import org.apache.spark.util.{AkkaUtils, Utils}
4343
* :: DeveloperApi ::
4444
* Holds all the runtime environment objects for a running Spark instance (either master or worker),
4545
* including the serializer, Akka actor system, block manager, map output tracker, etc. Currently
46-
* Spark code finds the SparkEnv through a thread-local variable, so each thread that accesses these
47-
* objects needs to have the right SparkEnv set. You can get the current environment with
48-
* SparkEnv.get (e.g. after creating a SparkContext) and set it with SparkEnv.set.
46+
* Spark code finds the SparkEnv through a global variable, so all the threads can access the same
47+
* SparkEnv. It can be accessed by SparkEnv.get (e.g. after creating a SparkContext).
4948
*
5049
* NOTE: This is not intended for external use. This is exposed for Shark and may be made private
5150
* in a future release.
@@ -129,20 +128,12 @@ object SparkEnv extends Logging {
129128
}
130129

131130
/**
132-
* Returns the ThreadLocal SparkEnv, if non-null. Else returns the SparkEnv
133-
* previously set in any thread.
131+
* Returns the SparkEnv.
134132
*/
135133
def get: SparkEnv = {
136134
env
137135
}
138136

139-
/**
140-
* Returns the ThreadLocal SparkEnv.
141-
*/
142-
def getThreadLocal: SparkEnv = {
143-
env
144-
}
145-
146137
private[spark] def create(
147138
conf: SparkConf,
148139
executorId: String,

0 commit comments

Comments
 (0)