Skip to content

Commit

Permalink
Style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed Feb 29, 2016
1 parent 7218567 commit d6b3fb0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/src/main/scala/org/apache/spark/util/ThreadUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,14 @@ private[spark] object ThreadUtils {
* Construct a new Java ForkJoinPool with a specified max parallelism and name prefix.
*/
def newForkJoinPool(prefix: String, maxThreadNumber: Int): ForkJoinPool = {
/**
* Extend ForkJoinWorkerThread so we can instantiate it.
*/
class SparkForkJoinWorkerThread(pool: ForkJoinPool) extends ForkJoinWorkerThread(pool) {
}
/**
* Custom ForkJoinWorkerThreadFactory to specify the thread name.
*/
class SparkForkJoinFactory extends ForkJoinPool.ForkJoinWorkerThreadFactory {
override def newThread(pool: ForkJoinPool): ForkJoinWorkerThread = {
val th = new SparkForkJoinWorkerThread(pool)
Expand All @@ -171,6 +177,9 @@ private[spark] object ThreadUtils {
}
}
val factory = new SparkForkJoinFactory()
new ForkJoinPool(maxThreadNumber, factory, null /* handler */, false /* asyncMode */)
new ForkJoinPool(maxThreadNumber, factory,
null, // handler
false // asyncMode
)
}
}

0 comments on commit d6b3fb0

Please sign in to comment.