spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From squito <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-7889] [CORE] HistoryServer to refresh c...
Date Tue, 08 Dec 2015 20:03:17 GMT
Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6935#discussion_r47005658
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
---
    @@ -430,8 +519,54 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock:
Clock)
         }
         newIterator.foreach(addIfAbsent)
         oldIterator.foreach(addIfAbsent)
    +    mergedApps
    +  }
    +
    +
    +  /**
    +   * Scan through all incomplete applications, and check for any that have changed.
    +   *
    +   * After the scan, if there were any updated attempts, [[applications]] is updated
    +   * with the new values.
    +   *
    +   * 1. No attempt to replay the application is made; this scan is a low cost operation.
    +   * 2. As this overwrites [[applications]] with a new value, it must not run concurrently
    +   */
    +  private[history] def scanAndUpdateIncompleteAttemptInfo(): Unit = {
    +    val now = System.currentTimeMillis();
    +    val newAttempts: Iterable[FsApplicationAttemptInfo] = applications
    +        .filter( e => !e._2.completed)
    +        .flatMap { e =>
    +          // build list of (false, attempt) or (true, attempt') values
    +          e._2.attempts.flatMap { attempt: FsApplicationAttemptInfo =>
    +            val path = new Path(logDir, attempt.logPath)
    +            try {
    +              val status = fs.getFileStatus(path)
    +              val size = getLogSize(status).getOrElse(-1L)
    +              val aS = attempt.fileSize
    +              if (size > aS) {
    --- End diff --
    
    if it should update on timestamp (even if filesizes stay the same), then you should check
timestamp here too


---
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