srowen commented on a change in pull request #26911: Remove usage of Guava that
breaks in 27; replace with workalikes
URL: https://github.com/apache/spark/pull/26911#discussion_r358417668
##########
File path: core/src/main/scala/org/apache/spark/util/ThreadUtils.scala
##########
@@ -19,21 +19,35 @@ package org.apache.spark.util
import java.util.concurrent._
-import scala.collection.generic.CanBuildFrom
-import scala.language.higherKinds
-
-import com.google.common.util.concurrent.{MoreExecutors, ThreadFactoryBuilder}
import scala.concurrent.{Awaitable, ExecutionContext,
ExecutionContextExecutor, Future}
import scala.concurrent.duration.{Duration, FiniteDuration}
+import scala.language.higherKinds
import scala.util.control.NonFatal
+import com.google.common.util.concurrent.ThreadFactoryBuilder
+
import org.apache.spark.SparkException
import org.apache.spark.rpc.RpcAbortException
private[spark] object ThreadUtils {
+ private val sameThreadService = new AbstractExecutorService {
Review comment:
This is the only non-trivial change I think. It's an ExecutorService that,
as desired, doesn't do any threads or scheduling. Each caller's submit() call
just blocks. It can't tell if a caller is still running something though
(awaitTermination doesn't wait on anything, for example). I think this is OK
given the purpose here? this is a lot less complex than the Guava one it
replaces though.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]