Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11867#discussion_r96939526
  
    --- Diff: 
core/src/main/scala/org/apache/spark/status/api/v1/ApplicationListResource.scala
 ---
    @@ -43,11 +45,24 @@ private[v1] class ApplicationListResource(uiRoot: 
UIRoot) {
           // keep the app if *any* attempts fall in the right time window
           ((!anyRunning && includeCompleted) || (anyRunning && 
includeRunning)) &&
           app.attempts.exists { attempt =>
    -        val start = attempt.startTime.getTime
    -        start >= minDate.timestamp && start <= maxDate.timestamp
    +        isAttemptInRange(attempt, minDate, maxDate, minEndDate, 
maxEndDate, anyRunning)
           }
         }.take(numApps)
       }
    +
    +  private def isAttemptInRange(
    +      attempt: ApplicationAttemptInfo,
    +      minStartDate: SimpleDateParam,
    +      maxStartDate: SimpleDateParam,
    +      minEndDate: SimpleDateParam,
    +      maxEndDate: SimpleDateParam,
    +      skipEndTimeValidation: Boolean): Boolean = {
    +    val startTimeOk = attempt.startTime.getTime >= minStartDate.timestamp 
&&
    +      attempt.startTime.getTime <= maxStartDate.timestamp
    +    val endTimeOk = skipEndTimeValidation || (attempt.endTime.getTime >= 
minEndDate.timestamp &&
    --- End diff --
    
    if you have a `maxEndDate` in the past, would you expect running 
applications to show up?  I guess that is fine -- the user should filter on 
status as well in that case, but maybe worth documenting


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

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

Reply via email to