-
Notifications
You must be signed in to change notification settings - Fork 29k
SPARK-11344: Made ApplicationDescription and DriverDescription case classes #9299
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
Conversation
|
I'm not an expert here but I tend to like this kind of change. |
|
Test build #44427 has finished for PR 9299 at commit
|
|
Thanks @srowen |
1870a5a to
4eb1f97
Compare
|
Test build #44441 has finished for PR 9299 at commit
|
4eb1f97 to
169c053
Compare
|
Test build #44446 has finished for PR 9299 at commit
|
|
@JoshRosen could you verify this? |
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.
This is the only possible downside, that you only moved the mutable field to another class. Still, I think it is a reasonable update. @JoshRosen ?
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.
Yes, I moved it to that class because it represent a mutable state of application in the Master - and if the appUiUrl changes, it is due to application state change. This class has many more mutable fields so it doesn't make it worse. The main purpose of this ticket was to move out mutable fields from ApplicationDescription which is used to transfer data from one process to another and by definition it should be immutable.
|
CC @andrewor14 for a look but I think this is an OK small refactoring. |
|
@jacek-lewandowski on one final re-read my last question is -- why does |
|
@srowen That is the intent. I think I cannot remove it from |
|
OK then the value in |
|
@srowen I can rename it if you insist. However, this value is in fact immutable. The driver UI address does not get changed. Master replaces URLs which points to driver's UI when the driver is dead, but this doesn't mean the driver UI address was changed. It just became unavailable. So, imo the current names are ok. Though, if you think they are confusing, it would be better to change the name in |
|
I don't think the fact that one of the values is immutable matters. There are two copies of the same value within the same object (in So maybe |
|
Ok, agree |
|
Test build #44803 has finished for PR 9299 at commit
|
|
@srowen ^ |
|
Looking good to me. Let me leave it a bit for other input. |
|
merged to master |
DriverDescription refactored to case class because it included no mutable fields.
ApplicationDescription had one mutable field, which was appUiUrl. This field was set by the driver to point to the driver web UI. Master was modifying this field when the application was removed to redirect requests to history server. This was wrong because objects which are sent over the wire should be immutable. Now appUiUrl is immutable in ApplicationDescription and always points to the driver UI even if it is already shutdown. The UI url which master exposes to the user and modifies dynamically is now included into ApplicationInfo - a data object which describes the application state internally in master. That URL in ApplicationInfo is initialised with the value from ApplicationDescription.
ApplicationDescription also included value user, which is now a part of case class fields.