Uh oh!
There was an error while loading. Please reload this page.
[SPARK-17672] Spark 2.0 history server web Ui takes too long for a single application - #15247
[SPARK-17672] Spark 2.0 history server web Ui takes too long for a single application#15247wgtmac wants to merge 4 commits into
Conversation
ajbozarth
left a comment
There was a problem hiding this comment.
Overall I like this addition, just a couple comments
| } | ||
| def getApplicationInfo(appId: String): Option[ApplicationInfo] = { | ||
| throw new UnsupportedOperationException() |
There was a problem hiding this comment.
I think this would be better to return the expected result (the info if the id matches or a None if it doesn't) rather than throw an UnsupportedException, just for consistency
| case Some(LoadedAppUI(ui, updateState)) => | ||
| val completed = ui.getApplicationInfoList.exists(_.attempts.last.completed) | ||
| val completed = ui.getApplicationInfo(appId) | ||
| .map(_.attempts.last.completed).getOrElse(false) |
There was a problem hiding this comment.
Though I get what you're trying to do here, I'm not sure this is actually faster in this case since the list is only length one. It may be cleaner to leave this as is, what are other reviewers opinions?
There was a problem hiding this comment.
Makes sense. I'll roll it back.
There was a problem hiding this comment.
So while reviewing #15248 I think this original change actually might be better, mostly because it removes dependance both the getApplicationInfoList method that you're working with in that pr, even if it "looks" less clean.
If this passes tests, LGTM |
vanzin
commented
Sep 28, 2016
ok to test |
SparkQA
commented
Sep 28, 2016
Test build #66004 has finished for PR 15247 at commit
|
SparkQA
commented
Sep 28, 2016
Test build #66013 has finished for PR 15247 at commit
|
| } | ||
| def getApplicationInfo(appId: String): Option[ApplicationInfo] = { | ||
| if (appId == this.appId) { |
There was a problem hiding this comment.
I'd rather this one use the iterator.find approach to avoid duplication. It's a one item list anyway.
There was a problem hiding this comment.
Good point. I've made this change.
vanzin
commented
Sep 28, 2016
One minor comment otherwise looks ok. |
SparkQA
commented
Sep 28, 2016
Test build #66050 has finished for PR 15247 at commit
|
Anyone knows why the last test failed in the sql module? My change has nothing to do with it. |
ajbozarth
commented
Sep 28, 2016
Jenkins, retest this please |
SparkQA
commented
Sep 28, 2016
Test build #66059 has finished for PR 15247 at commit
|
wgtmac
commented
Sep 29, 2016
Another test failed in the mllib: org.apache.spark.mllib.classification.NaiveBayesSuite.Naive Bayes Multinomial @ajbozarth Have you seen this kind of unrelated failure before? Do I have the permission to trigger the test? Thanks! |
vanzin
commented
Sep 29, 2016
retest this please |
SparkQA
commented
Sep 29, 2016
Test build #66110 has finished for PR 15247 at commit
|
| /** | ||
| * Returns an ApplicationHistoryInfo for the appId. | ||
| * | ||
| * @return ApplicationHistoryInfo of one appId if exists. |
There was a problem hiding this comment.
This is kind of verbose. I would just say @return the [[ApplicationHistoryInfo]] for the appId if it exists
There was a problem hiding this comment.
I'll fix this myself when I merge
| getApplicationList().iterator.map(ApplicationsListResource.appHistoryInfoToPublicAppInfo) | ||
| } | ||
| def getApplicationInfo(appId: String): Option[ApplicationInfo] = { |
There was a problem hiding this comment.
I believe this is a public API, but it's a reasonable one
| private[spark] trait UIRoot { | ||
| def getSparkUI(appKey: String): Option[SparkUI] | ||
| def getApplicationInfoList: Iterator[ApplicationInfo] | ||
| def getApplicationInfo(appId: String): Option[ApplicationInfo] |
andrewor14
commented
Sep 29, 2016
LGTM merging into master 2.0, thanks. |
…ngle application Added a new API getApplicationInfo(appId: String) in class ApplicationHistoryProvider and class SparkUI to get app info. In this change, FsHistoryProvider can directly fetch one app info in O(1) time complexity compared to O(n) before the change which used an Iterator.find() interface. Both ApplicationCache and OneApplicationResource classes adopt this new api. manual tests Author: Gang Wu <wgtmac@uber.com> Closes#15247 from wgtmac/SPARK-17671. (cherry picked from commit cb87b3c) Signed-off-by: Andrew Or <andrewor14@gmail.com>
What changes were proposed in this pull request?
Added a new API getApplicationInfo(appId: String) in class ApplicationHistoryProvider and class SparkUI to get app info. In this change, FsHistoryProvider can directly fetch one app info in O(1) time complexity compared to O(n) before the change which used an Iterator.find() interface.
Both ApplicationCache and OneApplicationResource classes adopt this new api.
How was this patch tested?
manual tests