Skip to content

Commit 89ed7b1

Browse files
committed
[SPARK-23820][CORE] Enable use of long form of callsite in logs
1 parent 97d4afa commit 89ed7b1

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

core/src/main/scala/org/apache/spark/internal/config/package.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ package object config {
7777
private[spark] val EVENT_LOG_OVERWRITE =
7878
ConfigBuilder("spark.eventLog.overwrite").booleanConf.createWithDefault(false)
7979

80+
private[spark] val EVENT_LOG_CALLSITE_LONG_FORM =
81+
ConfigBuilder("spark.eventLog.longForm.enabled").booleanConf.createWithDefault(false)
82+
8083
private[spark] val EXECUTOR_CLASS_PATH =
8184
ConfigBuilder(SparkLauncher.EXECUTOR_EXTRA_CLASSPATH).stringConf.createOptional
8285

core/src/main/scala/org/apache/spark/storage/RDDInfo.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
package org.apache.spark.storage
1919

20+
import org.apache.spark.SparkEnv
2021
import org.apache.spark.annotation.DeveloperApi
22+
import org.apache.spark.internal.config._
2123
import org.apache.spark.rdd.{RDD, RDDOperationScope}
2224
import org.apache.spark.util.Utils
2325

@@ -53,10 +55,17 @@ class RDDInfo(
5355
}
5456

5557
private[spark] object RDDInfo {
58+
private val callsiteLongForm = SparkEnv.get.conf.get(EVENT_LOG_CALLSITE_LONG_FORM)
59+
5660
def fromRdd(rdd: RDD[_]): RDDInfo = {
5761
val rddName = Option(rdd.name).getOrElse(Utils.getFormattedClassName(rdd))
5862
val parentIds = rdd.dependencies.map(_.rdd.id)
63+
val callSite = if (callsiteLongForm) {
64+
rdd.creationSite.longForm
65+
} else {
66+
rdd.creationSite.shortForm
67+
}
5968
new RDDInfo(rdd.id, rddName, rdd.partitions.length,
60-
rdd.getStorageLevel, parentIds, rdd.creationSite.shortForm, rdd.scope)
69+
rdd.getStorageLevel, parentIds, callSite, rdd.scope)
6170
}
6271
}

docs/configuration.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,13 @@ Apart from these, the following properties are also available, and may be useful
746746
*Warning*: This will increase the size of the event log considerably.
747747
</td>
748748
</tr>
749+
<tr>
750+
<td><code>spark.eventLog.longForm.enabled</code></td>
751+
<td>false</td>
752+
<td>
753+
If true, use the long form of call sites in the event log. Otherwise use the short form.
754+
</td>
755+
</tr>
749756
<tr>
750757
<td><code>spark.eventLog.compress</code></td>
751758
<td>false</td>

0 commit comments

Comments
 (0)