[SPARK-7889] [Core] WiP History Caching: xu tingjun's patch against master #9913
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.
This is @XuTingjun's patch (#6545) reapplied to trunk with a bit of cleanup (the probe in the history provider is now
isComplete(String appId, Option[String] attemptId; the conditions around its use and is internals slightly tweaked.Looking at this code now, I do agree the history provider should have a say in the state of the attempts, I'm not sure if this is the right approach. Having 3x different maps to track app state (including two that never get cleaned up) isn't ideal, and if it were to be so, then the two new ones would have to be thread safe, so as to handle the scenario of "multiple requests coming in at the same time"
I'd rather retain the history server's information alongside the cached app, (as my patch does), though that still leaves the question of how to probe for a updated version and then reload it, especially in a way that is thread safe.
Oh, and testing, obviously.
(once this PR has been tested I'm going to close it; it's here as reference)