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
[SPARK-29599][WEBUI] Support pagination for session table in JDBC/ODBC Tab #26253
Conversation
ok to test |
Test build #112658 has finished for PR 26253 at commit
|
|
||
override def sliceData(from: Int, to: Int): Seq[SessionInfo] = { | ||
val r = data.slice(from, to) | ||
r.map(x => x) |
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: what does this do?
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: what does this do?
For paging, get selected pages data.
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.
No, I mean, .map(x => x)
is a no-op right? what is this line for?
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.
No, I mean,
.map(x => x)
is a no-op right? what is this line for?
Same implement with #26215
Since same function... so don't check this method.
Remove both of these.
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, we can remove the line.
} | ||
|
||
private def errorMessageCell(errorMessage: String): Seq[Node] = { | ||
val isMultiline = errorMessage.indexOf('\n') >= 0 |
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.
Is this method used anywhere?
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.
Is this method used anywhere?
All remove
</td> | ||
} | ||
|
||
private def jobURL(request: HttpServletRequest, jobId: String): String = |
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 method also seems not used?
|
||
override def sliceData(from: Int, to: Int): Seq[SessionInfo] = { | ||
val r = data.slice(from, to) | ||
r.map(x => x) |
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, we can remove the line.
val sessionTableHeaders = | ||
Seq("User", "IP", "Session ID", "Start Time", "Finish Time", "Duration", "Total Execute") | ||
|
||
val tooltips = Seq[Option[String]](None, None, None, None, None, None, None) |
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.
Do we need tooltips
for the table?
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.
Do we need
tooltips
for the table?
Ok for me to remove these. If we all think don't need and won't add some thing, just remove it.
By the way, thanks a lot for you nice job. This problem trouble me a lot
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 there is already a PR working on it, related to tool tips here, #26138
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 there is already a PR working on it, related to tool tips here, #26138
Very embarrassed..., for me , this table's information is so clear. Don't add tooltip is ok.
<td> {formatDate(session.startTimestamp)} </td> | ||
<td> {if (session.finishTimestamp > 0) formatDate(session.finishTimestamp)} </td> | ||
<td sorttable_customkey={session.totalTime.toString}> | ||
{formatDurationOption(Some(session.totalTime))} </td> |
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, we can directly call UIUtils.formatDurationVerbose
, because totalTime
is always defined. Also can remove the method formatDurationOption
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, we can directly call
UIUtils.formatDurationVerbose
, becausetotalTime
is always defined. Also can remove the methodformatDurationOption
Good suggestion. Removed other old unused code, feel comfortable now.
Test build #112669 has finished for PR 26253 at commit
|
Test build #112675 has finished for PR 26253 at commit
|
}.getOrElse("Start Time") | ||
val sessionTableSortDesc = Option(parameterSessionTableSortDesc).map(_.toBoolean).getOrElse( | ||
// Old session should be shown above new session by default. | ||
!(sessionTableSortColumn == "Start Time") |
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.
@AngersZhuuuu By default new session should come above right? (Screenshot from master branch)
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.
@AngersZhuuuu By default new session should come above right? (Screenshot from master branch)
Updated, I could have been misled by the modified thriftserver I was using
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.
LGTM, pending one comment.
Test build #112687 has finished for PR 26253 at commit
|
Just need to resolve the merge conflict too |
Test build #112723 has finished for PR 26253 at commit
|
Done |
<td> <a href={sessionLink}> {session.sessionId} </a> </td> | ||
<td> {formatDate(session.startTimestamp)} </td> | ||
<td> {if (session.finishTimestamp > 0) formatDate(session.finishTimestamp)} </td> | ||
<td sorttable_customkey={session.totalTime.toString}> |
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: Is it necessary to add sorttable_customkey
as we are already sorting using raw data in ordering
method?
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: Is it necessary to add
sorttable_customkey
as we are already sorting using raw data inordering
method?
This seems to be the previous pr, change to use raw data for sort column, old version didn't have this and trouble me a lot. Don't need it.
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.
Also, please confirm if the sorting is working properly after changing this. Thanks
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.
Also, please confirm if the sorting is working properly after changing this. Thanks
Checked ok. Thanks
} | ||
Some(UIUtils.listingTable(headerRow, generateDataRow, dataRows, true, None, Seq(null), false)) |
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: Here for the sessions table fixedWidth
is true. right? Are we making the paged table also fixed width?
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.
fixedWidth
Changed. Not so familiar with UI HTML part, thanks a lot for your suggestion
Test build #112731 has finished for PR 26253 at commit
|
Test build #112732 has finished for PR 26253 at commit
|
Merged to master |
What changes were proposed in this pull request?
In this PR, extend the support of pagination to session table in
JDBC/PDBC
.Why are the changes needed?
Some times we may connect a lot client and there a many session info shown in session tab.
make it can be paged for better view.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Manuel verify.
After pr: