-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-31688][WEBUI] Refactor Pagination framework #28512
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
|
cc @srowen @uncleGen @sarutak @HyukjinKwon Kindly review. |
|
ok to test. |
|
Test build #122565 has finished for PR 28512 at commit
|
|
retest this please. |
| def getTableParameters(request: HttpServletRequest, tableTag: String, | ||
| defaultSortColumn: String): (String, Boolean, Int) = { |
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.
nit: all arguments in one line or each one in separate line.
|
Test build #122570 has finished for PR 28512 at commit
|
|
Test build #122591 has finished for PR 28512 at commit
|
|
Test build #122594 has finished for PR 28512 at commit
|
|
retest this please |
|
Jenkins test this please |
|
Test build #122736 has finished for PR 28512 at commit
|
|
I don't know enough to have a strong opinion, but it looks plausible and I think you know this code well. If it doesn't introduce any behavior change, just a cleanup, I think it's OK. |
|
Now I'm checking and will leave comment. |
sarutak
left a comment
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.
Thanks @iRakson for the refactoring!
It almost LGTM.
I've left some minor comments.
| } | ||
|
|
||
| override def headers: Seq[Node] = { | ||
| // Information for each header: title, cssClass, and sortable |
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.
Could you update the comment?
| */ | ||
| def isSortColumnValid( | ||
| headerInfo: Seq[(String, Boolean, Option[String])], | ||
| sortColumn: String): Any = { |
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.
The return type is better to be Unit rather than Any isn't it?
| isFairScheduler: Boolean, | ||
| killEnabled: Boolean, | ||
| isFailedStage: Boolean) { | ||
| val parameterOtherTable = request.getParameterMap().asScala |
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.
JavaConverters._ is imported but it may be no longer used after this change.
| jobTag: String, | ||
| jobs: Seq[v1.JobData], | ||
| killEnabled: Boolean): Seq[Node] = { | ||
| val parameterOtherTable = request.getParameterMap().asScala |
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.
Same comment as here.
| val headerRow: Seq[Node] = { | ||
| jobHeadersAndCssClasses.map { case (header, cssClass, sortable, tooltip) => | ||
| if (header == sortColumn) { | ||
| val headerLink = Unparsed( |
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.
Unparsed is imported but it's no longer used after this change.
| } | ||
|
|
||
| override def headers: Seq[Node] = { | ||
| // Information for each header: title, sortable |
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.
Same comment as here.
| val headerRow: Seq[Node] = { | ||
| sqlTableHeaders.zip(tooltips).map { case (header, tooltip) => | ||
| if (header == sortColumn) { | ||
| val headerLink = Unparsed( |
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.
Same comment as here.
|
|
||
| val sqlTableTag = "sqlsessionstat" | ||
|
|
||
| val parameterOtherTable = request.getParameterMap().asScala |
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.
Same comment as here.
| s"&$sessionStatsTableTag.pageSize=$pageSize" + | ||
| s"#$sessionStatsTableTag") | ||
| val arrow = if (desc) "▾" else "▴" // UP or DOWN | ||
| <th width={colWidthAttr}> |
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.
PagedTable#headerRow you added doesn't support the width of th.
Did you confirm it doesn't matter for ThriftServerPage?
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.
| } | ||
| } | ||
| <thead> | ||
| {row} |
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.
{row} should be enclosed by <tr>.
|
@sarutak Thank You for reviewing. Code is updated as per suggestions. |
|
Test build #122899 has finished for PR 28512 at commit
|
|
Merged to master |

What changes were proposed in this pull request?
Currently while implementing pagination using the existing pagination framework, a lot of code is being copied as pointed out here.
I introduced some changes in
PagedTablewhich is the main trait for implementing the pagination.Why are the changes needed?
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Manually. This is mainly refactoring work, no new functionality introduced. Existing test cases should pass.