spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrewor14 <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-9026] Modifications to JobWaiter, Futur...
Date Wed, 11 Nov 2015 19:37:46 GMT
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9264#discussion_r44575745
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/JobWaiter.scala ---
    @@ -28,17 +32,15 @@ private[spark] class JobWaiter[T](
         resultHandler: (Int, T) => Unit)
       extends JobListener {
     
    -  private var finishedTasks = 0
    -
    -  // Is the job as a whole finished (succeeded or failed)?
    -  @volatile
    -  private var _jobFinished = totalTasks == 0
    -
    -  def jobFinished: Boolean = _jobFinished
    -
    +  private val finishedTasks = new AtomicInteger(0)
       // If the job is finished, this will be its result. In the case of 0 task jobs (e.g.
zero
       // partition RDDs), we set the jobResult directly to JobSucceeded.
    -  private var jobResult: JobResult = if (jobFinished) JobSucceeded else null
    +  private val jobPromise : Promise[Unit] =
    +    if (totalTasks == 0) Promise.successful(()) else Promise()
    +
    +  def jobFinished: Boolean = jobPromise.isCompleted
    +
    +  def completionFuture : Future[Unit] = jobPromise.future
    --- End diff --
    
    no space before `:`, here and everywhere


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message