Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Optimize the lock in StreamingJobProgressListener to not block UI whe…
…n generating Streaming jobs
  • Loading branch information
uncleGen committed Jan 16, 2017
commit 46036bf683632e03f970de20f7bcd17b5369d5dc
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,10 @@ final private[streaming] class DStreamGraph extends Serializable with Logging {

def generateJobs(time: Time): Seq[Job] = {
logDebug("Generating jobs for time " + time)
val jobs = this.synchronized {
outputStreams.flatMap { outputStream =>
val jobOption = outputStream.generateJob(time)
jobOption.foreach(_.setCallSite(outputStream.creationSite))
jobOption
}
val jobs = getOutputStreams().flatMap { outputStream =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

synchronized is to make sure writeObject never write some intermediate states of DStreamGraph.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have put the question to be too simple

val jobOption = outputStream.generateJob(time)
jobOption.foreach(_.setCallSite(outputStream.creationSite))
jobOption
}
logDebug("Generated " + jobs.length + " jobs for time " + time)
jobs
Expand Down