Github user jerryshao commented on a diff in the pull request: https://github.com/apache/spark/pull/14312#discussion_r72196631 --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala --- @@ -2418,6 +2419,25 @@ private[spark] object Utils extends Logging { sparkJars.map(_.split(",")).map(_.filter(_.nonEmpty)).toSeq.flatten } } + + def setCallerContext(context: String): Unit = { + try { + val Builder = Utils.classForName("org.apache.hadoop.ipc.CallerContext$Builder") + val builderInst = Builder.getConstructor(classOf[String]).newInstance(context) + val ret = Builder.getMethod("build").invoke(builderInst) + val callerContext = Utils.classForName("org.apache.hadoop.ipc.CallerContext") + callerContext.getMethod("setCurrent", callerContext).invoke(null, ret) + } + catch { --- End diff -- nit: catch should follow the above `}`.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org