Skip to content

Commit d5c1aa9

Browse files
author
Izek Greenfield
committed
style changes
1 parent 0685aba commit d5c1aa9

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

core/src/main/scala/org/apache/spark/executor/Executor.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private[spark] class Executor(
108108
.setNameFormat("Executor task launch worker-%d")
109109
.setThreadFactory((r: Runnable) => new UninterruptibleThread(r, "unused"))
110110
.build()
111-
ThreadUtils.newCachedThreadPool(threadFactory)
111+
Executors.newCachedThreadPool(threadFactory).asInstanceOf[ThreadPoolExecutor]
112112
}
113113
private val executorSource = new ExecutorSource(threadPool, executorId)
114114
// Pool used for threads that supervise task killing / cancellation
@@ -326,7 +326,7 @@ private[spark] class Executor(
326326
.filter(_._1.startsWith("mdc.")).map { item =>
327327
val key = item._1.substring(4)
328328
(key, item._2)
329-
}.toMap
329+
}.toSeq
330330

331331
/** If specified, this task has been killed and this option contains the reason. */
332332
@volatile private var reasonIfKilled: Option[String] = None
@@ -402,7 +402,7 @@ private[spark] class Executor(
402402

403403
override def run(): Unit = {
404404

405-
setMDCForTask(taskDescription.name, mdcProperties)
405+
setMDCForTask(taskName, mdcProperties)
406406

407407
threadId = Thread.currentThread.getId
408408
Thread.currentThread.setName(threadName)
@@ -702,7 +702,7 @@ private[spark] class Executor(
702702
}
703703
}
704704

705-
private def setMDCForTask(taskName: String, mdc: scala.collection.Map[String, String]): Unit = {
705+
private def setMDCForTask(taskName: String, mdc: Seq[(String, String)]): Unit = {
706706
MDC.put("taskName", taskName)
707707

708708
mdc.foreach { case (key, value) =>

core/src/main/scala/org/apache/spark/util/ThreadUtils.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,6 @@ private[spark] object ThreadUtils {
133133
Executors.newCachedThreadPool(threadFactory).asInstanceOf[ThreadPoolExecutor]
134134
}
135135

136-
/**
137-
* Wrapper over newCachedThreadPool. Thread names are formatted as prefix-ID, where ID is a
138-
* unique, sequentially assigned integer.
139-
*/
140-
def newCachedThreadPool(threadFactory: ThreadFactory): ThreadPoolExecutor = {
141-
Executors.newCachedThreadPool(threadFactory).asInstanceOf[ThreadPoolExecutor]
142-
}
143-
144136
/**
145137
* Create a cached thread pool whose max number of threads is `maxThreadNumber`. Thread names
146138
* are formatted as prefix-ID, where ID is a unique, sequentially assigned integer.

0 commit comments

Comments
 (0)