-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-8593] [core] Sort app attempts by start time. #7253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e3677c9
Merge pull request #1 from apache/master
rekhajoshm 106fd8e
Merge pull request #2 from apache/master
rekhajoshm 0be142d
Merge pull request #3 from apache/master
rekhajoshm ab65fa1
History Server: some attempt completed to work with showIncomplete
rekhajoshm a41ac4b
History Server: updated order for multiple attempts
rekhajoshm 85024e8
History Server: updated order for multiple attempts
rekhajoshm 304cb0b
History Server: updated order for multiple attempts(reverted HistoryP…
rekhajoshm cc0fda7
History Server: updated order for multiple attempts(updated test)
rekhajoshm b0fc922
History Server: updated order for multiple attempts(updated comment)
rekhajoshm 83306a8
History Server: updated order for multiple attempts(descending start …
rekhajoshm 548c753
History Server: updated order for multiple attempts(descending start …
rekhajoshm 716e0b1
History Server: updated order for multiple attempts(descending start …
rekhajoshm 874dd80
History Server: updated order for multiple attempts(logcleaner)
rekhajoshm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,61 +64,61 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("") | |
| {providerConfig.map { case (k, v) => <li><strong>{k}:</strong> {v}</li> }} | ||
| </ul> | ||
| { | ||
| // This displays the indices of pages that are within `plusOrMinus` pages of | ||
| // the current page. Regardless of where the current page is, this also links | ||
| // to the first and last page. If the current page +/- `plusOrMinus` is greater | ||
| // than the 2nd page from the first page or less than the 2nd page from the last | ||
| // page, `...` will be displayed. | ||
| if (allAppsSize > 0) { | ||
| val leftSideIndices = | ||
| rangeIndices(actualPage - plusOrMinus until actualPage, 1 < _, requestedIncomplete) | ||
| val rightSideIndices = | ||
| rangeIndices(actualPage + 1 to actualPage + plusOrMinus, _ < pageCount, | ||
| requestedIncomplete) | ||
|
|
||
| <h4> | ||
| Showing {actualFirst + 1}-{last + 1} of {allAppsSize} | ||
| {if (requestedIncomplete) "(Incomplete applications)"} | ||
| <span style="float: right"> | ||
| { | ||
| if (actualPage > 1) { | ||
| <a href={makePageLink(actualPage - 1, requestedIncomplete)}>< </a> | ||
| <a href={makePageLink(1, requestedIncomplete)}>1</a> | ||
| } | ||
| } | ||
| {if (actualPage - plusOrMinus > secondPageFromLeft) " ... "} | ||
| {leftSideIndices} | ||
| {actualPage} | ||
| {rightSideIndices} | ||
| {if (actualPage + plusOrMinus < secondPageFromRight) " ... "} | ||
| { | ||
| if (actualPage < pageCount) { | ||
| <a href={makePageLink(pageCount, requestedIncomplete)}>{pageCount}</a> | ||
| <a href={makePageLink(actualPage + 1, requestedIncomplete)}> ></a> | ||
| } | ||
| } | ||
| </span> | ||
| </h4> ++ | ||
| // This displays the indices of pages that are within `plusOrMinus` pages of | ||
|
||
| // the current page. Regardless of where the current page is, this also links | ||
| // to the first and last page. If the current page +/- `plusOrMinus` is greater | ||
| // than the 2nd page from the first page or less than the 2nd page from the last | ||
| // page, `...` will be displayed. | ||
| if (allAppsSize > 0) { | ||
| val leftSideIndices = | ||
| rangeIndices(actualPage - plusOrMinus until actualPage, 1 < _, requestedIncomplete) | ||
| val rightSideIndices = | ||
| rangeIndices(actualPage + 1 to actualPage + plusOrMinus, _ < pageCount, | ||
| requestedIncomplete) | ||
|
|
||
| <h4> | ||
| Showing {actualFirst + 1}-{last + 1} of {allAppsSize} | ||
| {if (requestedIncomplete) "(Incomplete applications)"} | ||
| <span style="float: right"> | ||
| { | ||
| if (actualPage > 1) { | ||
| <a href={makePageLink(actualPage - 1, requestedIncomplete)}>< </a> | ||
| <a href={makePageLink(1, requestedIncomplete)}>1</a> | ||
| } | ||
| } | ||
| {if (actualPage - plusOrMinus > secondPageFromLeft) " ... "} | ||
| {leftSideIndices} | ||
| {actualPage} | ||
| {rightSideIndices} | ||
| {if (actualPage + plusOrMinus < secondPageFromRight) " ... "} | ||
| { | ||
| if (actualPage < pageCount) { | ||
| <a href={makePageLink(pageCount, requestedIncomplete)}>{pageCount}</a> | ||
| <a href={makePageLink(actualPage + 1, requestedIncomplete)}> ></a> | ||
| } | ||
| } | ||
| </span> | ||
| </h4> ++ | ||
| appTable | ||
| } else if (requestedIncomplete) { | ||
| <h4>No incomplete applications found!</h4> | ||
| } else { | ||
| <h4>No completed applications found!</h4> ++ | ||
| } else if (requestedIncomplete) { | ||
| <h4>No incomplete applications found!</h4> | ||
| } else { | ||
| <h4>No completed applications found!</h4> ++ | ||
| <p>Did you specify the correct logging directory? | ||
| Please verify your setting of <span style="font-style:italic"> | ||
| spark.history.fs.logDirectory</span> and whether you have the permissions to | ||
| access it.<br /> It is also possible that your application did not run to | ||
| completion or did not stop the SparkContext. | ||
| </p> | ||
| } | ||
| } | ||
| } | ||
| <a href={makePageLink(actualPage, !requestedIncomplete)}> | ||
| { | ||
| if (requestedIncomplete) { | ||
| "Back to completed applications" | ||
| } else { | ||
| "Show incomplete applications" | ||
| } | ||
| if (requestedIncomplete) { | ||
| "Back to completed applications" | ||
| } else { | ||
| "Show incomplete applications" | ||
| } | ||
| } | ||
| </a> | ||
| </div> | ||
|
|
@@ -146,18 +146,18 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("") | |
| "Last Updated") | ||
|
|
||
| private def rangeIndices( | ||
| range: Seq[Int], | ||
| condition: Int => Boolean, | ||
| showIncomplete: Boolean): Seq[Node] = { | ||
| range: Seq[Int], | ||
| condition: Int => Boolean, | ||
| showIncomplete: Boolean): Seq[Node] = { | ||
| range.filter(condition).map(nextPage => | ||
| <a href={makePageLink(nextPage, showIncomplete)}> {nextPage} </a>) | ||
| } | ||
|
|
||
| private def attemptRow( | ||
| renderAttemptIdColumn: Boolean, | ||
| info: ApplicationHistoryInfo, | ||
| attempt: ApplicationAttemptInfo, | ||
| isFirst: Boolean): Seq[Node] = { | ||
| renderAttemptIdColumn: Boolean, | ||
| info: ApplicationHistoryInfo, | ||
| attempt: ApplicationAttemptInfo, | ||
| isFirst: Boolean): Seq[Node] = { | ||
| val uiAddress = HistoryServer.getAttemptURI(info.id, attempt.attemptId) | ||
| val startTime = UIUtils.formatDate(attempt.startTime) | ||
| val endTime = if (attempt.endTime > 0) UIUtils.formatDate(attempt.endTime) else "-" | ||
|
|
@@ -170,31 +170,31 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("") | |
| val lastUpdated = UIUtils.formatDate(attempt.lastUpdated) | ||
| <tr> | ||
| { | ||
| if (isFirst) { | ||
| if (info.attempts.size > 1 || renderAttemptIdColumn) { | ||
| <td rowspan={info.attempts.size.toString} style="background-color: #ffffff"> | ||
| <a href={uiAddress}>{info.id}</a></td> | ||
| if (isFirst) { | ||
| if (info.attempts.size > 1 || renderAttemptIdColumn) { | ||
| <td rowspan={info.attempts.size.toString} style="background-color: #ffffff"> | ||
| <a href={uiAddress}>{info.id}</a></td> | ||
| <td rowspan={info.attempts.size.toString} style="background-color: #ffffff"> | ||
| {info.name}</td> | ||
| } else { | ||
| <td><a href={uiAddress}>{info.id}</a></td> | ||
| <td>{info.name}</td> | ||
| } | ||
| } else { | ||
| Nil | ||
| <td><a href={uiAddress}>{info.id}</a></td> | ||
| <td>{info.name}</td> | ||
| } | ||
| } else { | ||
| Nil | ||
| } | ||
| } | ||
| { | ||
| if (renderAttemptIdColumn) { | ||
| if (info.attempts.size > 1 && attempt.attemptId.isDefined) { | ||
| <td><a href={HistoryServer.getAttemptURI(info.id, attempt.attemptId)}> | ||
| {attempt.attemptId.get}</a></td> | ||
| } else { | ||
| <td> </td> | ||
| } | ||
| if (renderAttemptIdColumn) { | ||
| if (info.attempts.size > 1 && attempt.attemptId.isDefined) { | ||
| <td><a href={HistoryServer.getAttemptURI(info.id, attempt.attemptId)}> | ||
| {attempt.attemptId.get}</a></td> | ||
| } else { | ||
| Nil | ||
| <td> </td> | ||
| } | ||
| } else { | ||
| Nil | ||
| } | ||
| } | ||
| <td sorttable_customkey={attempt.startTime.toString}>{startTime}</td> | ||
| <td sorttable_customkey={attempt.endTime.toString}>{endTime}</td> | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wording is weird. What does "showing" mean?
I'd say: "sorted by descending start time", "sorted by descending end time".
Note, also, that your current code sorts in ascending order, while I think it should be the opposite.