Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/11867#discussion_r97391985
--- Diff:
core/src/main/scala/org/apache/spark/status/api/v1/ApplicationListResource.scala
---
@@ -43,11 +45,26 @@ 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,
+ anyRunning: Boolean): Boolean = {
+ val startTimeOk = attempt.startTime.getTime >= minStartDate.timestamp
&&
+ attempt.startTime.getTime <= maxStartDate.timestamp
+ val endTimeOkForRunning = anyRunning && (maxEndDate.timestamp >
System.currentTimeMillis())
--- End diff --
I dont' think its totally obvious what this is doing -- could you add a
comment above this: "If the maxEndDate is in the past, exclude all running
apps."
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]