Skip to content
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

Closed
wants to merge 8 commits into from

Conversation

AngersZhuuuu
Copy link
Contributor

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:
Screen Shot 2019-10-25 at 4 19 27 PM

Screen Shot 2019-10-25 at 4 19 38 PM

@AngersZhuuuu
Copy link
Contributor Author

cc @srowen @wangyum

@wangyum
Copy link
Member

wangyum commented Oct 25, 2019

ok to test

@SparkQA
Copy link

SparkQA commented Oct 25, 2019

Test build #112658 has finished for PR 26253 at commit dfa225b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.


override def sliceData(from: Int, to: Int): Seq[SessionInfo] = {
val r = data.slice(from, to)
r.map(x => x)
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor Author

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 =
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor Author

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>
Copy link
Contributor

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

Copy link
Contributor Author

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

Good suggestion. Removed other old unused code, feel comfortable now.

@SparkQA
Copy link

SparkQA commented Oct 25, 2019

Test build #112669 has finished for PR 26253 at commit f209cb4.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Oct 25, 2019

Test build #112675 has finished for PR 26253 at commit c7c9479.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

}.getOrElse("Start Time")
val sessionTableSortDesc = Option(parameterSessionTableSortDesc).map(_.toBoolean).getOrElse(
// Old session should be shown above new session by default.
!(sessionTableSortColumn == "Start Time")
Copy link
Contributor

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)
Screenshot 2019-10-25 at 11 04 15 PM

Copy link
Contributor Author

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

Copy link
Contributor

@shahidki31 shahidki31 left a 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.

@SparkQA
Copy link

SparkQA commented Oct 25, 2019

Test build #112687 has finished for PR 26253 at commit ce588e5.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Oct 26, 2019

Just need to resolve the merge conflict too

@SparkQA
Copy link

SparkQA commented Oct 27, 2019

Test build #112723 has finished for PR 26253 at commit 59697bc.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • abstract class BitAggregate extends DeclarativeAggregate with ExpectsInputTypes
  • case class BitAndAgg(child: Expression) extends BitAggregate
  • case class BitOrAgg(child: Expression) extends BitAggregate
  • case class BitXorAgg(child: Expression) extends BitAggregate
  • case class Version() extends LeafExpression with CodegenFallback
  • case class ShowCreateTableStatement(tableName: Seq[String]) extends ParsedStatement

@AngersZhuuuu
Copy link
Contributor Author

Just need to resolve the merge conflict too

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}>
Copy link
Contributor

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?

Copy link
Contributor Author

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?

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.

Copy link
Contributor

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

Copy link
Contributor Author

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))
Copy link
Contributor

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?

Copy link
Contributor Author

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

@SparkQA
Copy link

SparkQA commented Oct 27, 2019

Test build #112731 has finished for PR 26253 at commit 691eed1.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Oct 27, 2019

Test build #112732 has finished for PR 26253 at commit 5315c58.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen srowen closed this in d6e33dc Oct 28, 2019
@srowen
Copy link
Member

srowen commented Oct 28, 2019

Merged to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants