-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24851][UI] Map a Stage ID to it's Associated Job ID #21809
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 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7be0520
[SPARK-24851] : Map a Stage ID to it's Associated Job ID in UI
3151a62
[SPARK-24851] : Using both stage id as well as the attempt id to fetc…
a50e8b1
[SPARK-24851] : Avoiding extra store lookup and adding href links
d57e6dc
[SPARK-24851] : Fixing Scalastyle Tests
3a06b87
[SPARK-24851] : Adding exception handling part to avoid NoSuchElement…
52b08b2
[SPARK-24851] : Addressing reviews July 27
9eff537
[SPARK-24851] : Addressing Reviews August 9
3b73840
[SPARK-24851] : Addressing reviews September 28, 2018
0be099a
[SPARK-24851] : Addressing Reviews October 5, 2018
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |
| package org.apache.spark.ui.jobs | ||
|
|
||
| import java.net.URLEncoder | ||
| import java.util.Date | ||
| import java.util.{Date, NoSuchElementException} | ||
| import java.util.concurrent.TimeUnit | ||
| import javax.servlet.http.HttpServletRequest | ||
|
|
||
|
|
@@ -105,16 +105,29 @@ private[ui] class StagePage(parent: StagesTab, store: AppStatusStore) extends We | |
| val stageAttemptId = parameterAttempt.toInt | ||
|
|
||
| val stageHeader = s"Details for Stage $stageId (Attempt $stageAttemptId)" | ||
| val stageDataWrapper = parent.store.stageAttempt(stageId, stageAttemptId, details = false) | ||
| val stageData = parent.store | ||
| .asOption(stageDataWrapper.info) | ||
| .getOrElse { | ||
| var stageDataWrapper: StageDataWrapper = null | ||
| try { | ||
| stageDataWrapper = parent.store.stageAttempt(stageId, stageAttemptId, details = false) | ||
| } catch { | ||
| case e: NoSuchElementException => e.getMessage | ||
| } | ||
| var stageData: StageData = null | ||
| if (stageDataWrapper != null) { | ||
| stageData = parent.store | ||
| .asOption(stageDataWrapper.info) | ||
| .get | ||
| } else { | ||
| stageData = { | ||
|
||
| val content = | ||
| <div id="no-info"> | ||
| <p>No information to display for Stage {stageId} (Attempt {stageAttemptId})</p> | ||
| <p>No information to display for Stage | ||
| {stageId} | ||
| (Attempt | ||
| {stageAttemptId})</p> | ||
| </div> | ||
| return UIUtils.headerSparkPage(request, stageHeader, content, parent) | ||
| } | ||
| } | ||
|
|
||
| val stageJobIds = stageDataWrapper.jobIds.toSeq | ||
|
|
||
|
|
||
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.
I think you could use options here instead of try and null checks to make this cleaner
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.
Done, thanks!