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-29724][SPARK-29726][WEBUI][SQL] Support JDBC/ODBC tab for HistoryServer WebUI #26378

Closed
wants to merge 30 commits into from

Conversation

shahidki31
Copy link
Contributor

@shahidki31 shahidki31 commented Nov 3, 2019

What changes were proposed in this pull request?

Support JDBC/ODBC tab for HistoryServer WebUI. Currently from Historyserver we can't access the JDBC/ODBC tab for thrift server applications. In this PR, I am doing 2 main changes

  1. Refactor existing thrift server listener to support kvstore
  2. Add history server plugin for thrift server listener and tab.

Why are the changes needed?

Users can access Thriftserver tab from History server for both running and finished applications,

Does this PR introduce any user-facing change?

Support for JDBC/ODBC tab for the WEBUI from History server

How was this patch tested?

Add UT and Manual tests

  1. Start Thriftserver and Historyserver
sbin/stop-thriftserver.sh
sbin/stop-historyserver.sh
sbin/start-thriftserver.sh
sbin/start-historyserver.sh
  1. Launch beeline
    bin/beeline -u jdbc:hive2://localhost:10000

  2. Run queries

Go to the JDBC/ODBC page of the WebUI from History server

image

@SparkQA
Copy link

SparkQA commented Nov 3, 2019

Test build #113164 has finished for PR 26378 at commit f4a16a5.

  • This patch fails Scala style tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 3, 2019

Test build #113165 has finished for PR 26378 at commit bff90de.

  • This patch fails Scala style tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 3, 2019

Test build #113170 has finished for PR 26378 at commit 5490c8e.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 3, 2019

Test build #113166 has finished for PR 26378 at commit dfd1ff6.

  • This patch fails Spark unit tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 3, 2019

Test build #113171 has finished for PR 26378 at commit 24dde37.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class HiveThriftServer2HistoryServerPlugin extends AppHistoryServerPlugin
  • class HiveThriftServer2AppStatusStore(

@shahidki31
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Nov 3, 2019

Test build #113172 has finished for PR 26378 at commit 905e635.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class HiveThriftServer2HistoryServerPlugin extends AppHistoryServerPlugin
  • class HiveThriftServer2AppStatusStore(

@SparkQA
Copy link

SparkQA commented Nov 3, 2019

Test build #113173 has finished for PR 26378 at commit 4eab137.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class HiveThriftServer2HistoryServerPlugin extends AppHistoryServerPlugin
  • class HiveThriftServer2AppStatusStore(

@shahidki31
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Nov 4, 2019

Test build #113204 has finished for PR 26378 at commit 4eab137.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class HiveThriftServer2HistoryServerPlugin extends AppHistoryServerPlugin
  • class HiveThriftServer2AppStatusStore(

@shahidki31
Copy link
Contributor Author

shahidki31 commented Nov 4, 2019

Jenkins, retest this please

@shahidki31
Copy link
Contributor Author

Retest this please

@shahidki31 shahidki31 force-pushed the ThriftKVStore branch 2 times, most recently from 841f8a5 to 540faf0 Compare November 4, 2019 17:10
Copy link
Contributor Author

@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.

cc @vanzin , @cloud-fan , @wangym , @srowen , @AngersZhuuuu
Kindly review

@@ -121,179 +129,10 @@ object HiveThriftServer2 extends Logging {
}
}

private[thriftserver] class SessionInfo(
val sessionId: String,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code here and below are moved to HiveThriftServer2Listener.scala class

* An inner sparkListener called in sc.stop to clean up the HiveThriftServer2
*/
private[thriftserver] class HiveThriftServer2Listener(
val server: HiveServer2,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to a separate file (HiveThriftserver2Listener.scala)

ip: String,
sessionId: String,
userName: String,
startTime: Long) extends SparkListenerEvent
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New events added for Thriftserver applications. Eventually these events will be catch by the listeners EventLoggingListner as well as HiveThriftServer2Listener`

@@ -77,7 +77,8 @@ private[hive] class SparkExecuteStatementOperation(
// RDDs will be cleaned automatically upon garbage collection.
logInfo(s"Close statement with $statementId")
cleanup(OperationState.CLOSED)
HiveThriftServer2.listener.onOperationClosed(statementId)
HiveThriftServer2.listener.postLiveListenerBus(SparkListenerOperationClosed(statementId,
System.currentTimeMillis()))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes here are below files are,

  1. posting the Thriftserver specific events to LiveListener Bus, so that it can get by both EvenLoggingListener (For HistoryServer) as well as HiveThriftServer2Listener (For live UI)

class HiveThriftServer2AppStatusStore(
store: KVStore,
val listener: Option[HiveThriftServer2Listener] = None) {

Copy link
Contributor Author

@shahidki31 shahidki31 Nov 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both Live and History UI will read from this store for populating the WEBUI

@SparkQA
Copy link

SparkQA commented Nov 4, 2019

Test build #113216 has finished for PR 26378 at commit 4eab137.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class HiveThriftServer2HistoryServerPlugin extends AppHistoryServerPlugin
  • class HiveThriftServer2AppStatusStore(

@SparkQA
Copy link

SparkQA commented Nov 4, 2019

Test build #113217 has finished for PR 26378 at commit 540faf0.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class HiveThriftServer2HistoryServerPlugin extends AppHistoryServerPlugin
  • class HiveThriftServer2AppStatusStore(

@shahidki31
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Nov 4, 2019

Test build #113224 has finished for PR 26378 at commit e965c5f.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class HiveThriftServer2HistoryServerPlugin extends AppHistoryServerPlugin
  • class HiveThriftServer2AppStatusStore(

@shahidki31
Copy link
Contributor Author

Not sure which test is failing. seems all UTs are passing as per the Jenkins report.

@SparkQA
Copy link

SparkQA commented Nov 4, 2019

Test build #113225 has finished for PR 26378 at commit e965c5f.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class HiveThriftServer2HistoryServerPlugin extends AppHistoryServerPlugin
  • class HiveThriftServer2AppStatusStore(

@SparkQA
Copy link

SparkQA commented Nov 5, 2019

Test build #113284 has finished for PR 26378 at commit 5c2932e.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 27, 2019

Test build #114490 has finished for PR 26378 at commit eaea6e3.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 27, 2019

Test build #114497 has finished for PR 26378 at commit db4269c.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 27, 2019

Test build #114492 has finished for PR 26378 at commit a55927e.

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

@SparkQA
Copy link

SparkQA commented Nov 27, 2019

Test build #114495 has finished for PR 26378 at commit af65eed.

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

Copy link
Contributor

@juliuszsompolski juliuszsompolski 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 scalastyle.

@SparkQA
Copy link

SparkQA commented Nov 27, 2019

Test build #114538 has finished for PR 26378 at commit f7fcc75.

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

Copy link
Member

@gengliangwang gengliangwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the work!

@gengliangwang
Copy link
Member

@shahidki31 one more comment, I have a good idea about fixing the UI tab order.
We can add a new API displayOrder in the trait AppHistoryServerPlugin(with default value as Int.MaxValue).
And then we can set the displayOrder of SQL tab as 0, and the thriftserver tab as 1

I will merge this one once this is updated.

@shahidki31
Copy link
Contributor Author

@shahidki31 one more comment, I have a good idea about fixing the UI tab order.
We can add a new API displayOrder in the trait AppHistoryServerPlugin(with default value as Int.MaxValue).
And then we can set the displayOrder of SQL tab as 0, and the thriftserver tab as 1

Yeah, that is a nice idea. Thanks @gengliangwang . I will update the code

@SparkQA
Copy link

SparkQA commented Nov 28, 2019

Test build #114558 has finished for PR 26378 at commit 2bc86c5.

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

@SparkQA
Copy link

SparkQA commented Nov 28, 2019

Test build #114569 has finished for PR 26378 at commit 39ddc89.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@shahidki31
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Nov 29, 2019

Test build #114603 has finished for PR 26378 at commit 39ddc89.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@shahidki31
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Nov 29, 2019

Test build #114625 has finished for PR 26378 at commit 39ddc89.

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

@gengliangwang
Copy link
Member

Thanks, merging to master

@shahidki31
Copy link
Contributor Author

Thanks a lot @gengliangwang @juliuszsompolski @AngersZhuuuu for the reviews

@shahidki31 shahidki31 deleted the ThriftKVStore branch November 30, 2019 05:50
attilapiros pushed a commit to attilapiros/spark that referenced this pull request Dec 6, 2019
…oryServer WebUI

### What changes were proposed in this pull request?

 Support JDBC/ODBC tab for HistoryServer WebUI. Currently from Historyserver we can't access the JDBC/ODBC tab for thrift server applications. In this PR, I am doing 2 main changes
1. Refactor existing thrift server listener to support kvstore
2. Add history server plugin for thrift server listener and tab.

### Why are the changes needed?
Users can access Thriftserver tab from History server for both running and finished applications,

### Does this PR introduce any user-facing change?
Support for JDBC/ODBC tab  for the WEBUI from History server

### How was this patch tested?
Add UT and Manual tests
1. Start Thriftserver and Historyserver
```
sbin/stop-thriftserver.sh
sbin/stop-historyserver.sh
sbin/start-thriftserver.sh
sbin/start-historyserver.sh
```
2. Launch beeline
`bin/beeline -u jdbc:hive2://localhost:10000`

3. Run queries

Go to the JDBC/ODBC page of the WebUI from History server

![image](https://user-images.githubusercontent.com/23054875/68365501-cf013700-0156-11ea-84b4-fda8008c92c4.png)

Closes apache#26378 from shahidki31/ThriftKVStore.

Authored-by: shahid <shahidki31@gmail.com>
Signed-off-by: Gengliang Wang <gengliang.wang@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
9 participants