Skip to content

Commit 46036bf

Browse files
committed
Optimize the lock in StreamingJobProgressListener to not block UI when generating Streaming jobs
1 parent de62ddf commit 46036bf

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

streaming/src/main/scala/org/apache/spark/streaming/DStreamGraph.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,10 @@ final private[streaming] class DStreamGraph extends Serializable with Logging {
112112

113113
def generateJobs(time: Time): Seq[Job] = {
114114
logDebug("Generating jobs for time " + time)
115-
val jobs = this.synchronized {
116-
outputStreams.flatMap { outputStream =>
117-
val jobOption = outputStream.generateJob(time)
118-
jobOption.foreach(_.setCallSite(outputStream.creationSite))
119-
jobOption
120-
}
115+
val jobs = getOutputStreams().flatMap { outputStream =>
116+
val jobOption = outputStream.generateJob(time)
117+
jobOption.foreach(_.setCallSite(outputStream.creationSite))
118+
jobOption
121119
}
122120
logDebug("Generated " + jobs.length + " jobs for time " + time)
123121
jobs

0 commit comments

Comments
 (0)