From 145b31cd152679d4dbd4e17d4d31d4d925df6cc8 Mon Sep 17 00:00:00 2001 From: Weiqing Yang Date: Fri, 4 Nov 2016 16:55:22 -0700 Subject: [PATCH 1/2] [SPARK-17710][Follow UP] Add comments to state why 'Utils.classForName' is not used --- core/src/main/scala/org/apache/spark/util/Utils.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index 22c28fba2087e..99ac0e4368f11 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -2539,6 +2539,8 @@ private[util] object CallerContext extends Logging { val callerContextSupported: Boolean = { SparkHadoopUtil.get.conf.getBoolean("hadoop.caller.context.enabled", false) && { try { + // `Utils.classForName` will make `ReplSuite` fail with `ClassCircularityError` in + // master Maven build, so do not use it before resolving SPARK-17714. // scalastyle:off classforname Class.forName("org.apache.hadoop.ipc.CallerContext") Class.forName("org.apache.hadoop.ipc.CallerContext$Builder") @@ -2604,6 +2606,8 @@ private[spark] class CallerContext( def setCurrentContext(): Unit = { if (CallerContext.callerContextSupported) { try { + // `Utils.classForName` will make `ReplSuite` fail with `ClassCircularityErrors` in + // master Maven build, so do not use it before resolving SPARK-17714. // scalastyle:off classforname val callerContext = Class.forName("org.apache.hadoop.ipc.CallerContext") val builder = Class.forName("org.apache.hadoop.ipc.CallerContext$Builder") From 6ea137494cc9a8db1bc12cfd2329f3727c4bc4b0 Mon Sep 17 00:00:00 2001 From: Weiqing Yang Date: Fri, 4 Nov 2016 21:21:36 -0700 Subject: [PATCH 2/2] Update comments --- core/src/main/scala/org/apache/spark/util/Utils.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index 99ac0e4368f11..1de66af632a8a 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -2606,7 +2606,7 @@ private[spark] class CallerContext( def setCurrentContext(): Unit = { if (CallerContext.callerContextSupported) { try { - // `Utils.classForName` will make `ReplSuite` fail with `ClassCircularityErrors` in + // `Utils.classForName` will make `ReplSuite` fail with `ClassCircularityError` in // master Maven build, so do not use it before resolving SPARK-17714. // scalastyle:off classforname val callerContext = Class.forName("org.apache.hadoop.ipc.CallerContext")