aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorStephen Haberman <stephen@exigencecorp.com>2013-02-28 10:41:07 -0600
committerStephen Haberman <stephen@exigencecorp.com>2013-02-28 10:41:07 -0600
commit80eecd2cb14fa0c8017693241fa903bd09f46597 (patch)
tree4f0edccae7d92765f0314709a8ac86568d03c38e /core
parentd6e6abece306008c50410807669596d73d6d6738 (diff)
downloadspark-80eecd2cb14fa0c8017693241fa903bd09f46597.tar.gz
spark-80eecd2cb14fa0c8017693241fa903bd09f46597.tar.bz2
spark-80eecd2cb14fa0c8017693241fa903bd09f46597.zip
Make Executor fields volatile since they're read from the thread pool.
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/spark/executor/Executor.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/src/main/scala/spark/executor/Executor.scala b/core/src/main/scala/spark/executor/Executor.scala
index 5de09030aa..663dec2615 100644
--- a/core/src/main/scala/spark/executor/Executor.scala
+++ b/core/src/main/scala/spark/executor/Executor.scala
@@ -17,16 +17,16 @@ import java.nio.ByteBuffer
* The Mesos executor for Spark.
*/
private[spark] class Executor extends Logging {
- var urlClassLoader : ExecutorURLClassLoader = null
- var threadPool: ExecutorService = null
- var env: SparkEnv = null
+ @volatile private var urlClassLoader : ExecutorURLClassLoader = null
+ @volatile private var threadPool: ExecutorService = null
+ @volatile private var env: SparkEnv = null
// Application dependencies (added through SparkContext) that we've fetched so far on this node.
// Each map holds the master's timestamp for the version of that file or JAR we got.
- val currentFiles: HashMap[String, Long] = new HashMap[String, Long]()
- val currentJars: HashMap[String, Long] = new HashMap[String, Long]()
+ private val currentFiles: HashMap[String, Long] = new HashMap[String, Long]()
+ private val currentJars: HashMap[String, Long] = new HashMap[String, Long]()
- val EMPTY_BYTE_BUFFER = ByteBuffer.wrap(new Array[Byte](0))
+ private val EMPTY_BYTE_BUFFER = ByteBuffer.wrap(new Array[Byte](0))
initLogging()