-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-5100][SQL] add thriftserver-ui support #3946
Conversation
ok to test |
@@ -93,6 +94,13 @@ private[hive] class HiveThriftServer2(hiveContext: HiveContext) | |||
extends HiveServer2 | |||
with ReflectedCompositeService { | |||
|
|||
private[hive] val uiTab: Option[ThriftServerTab] = | |||
if (hiveContext.hiveconf.getBoolean("spark.ui.enabled", true)) { |
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.
It's a bit weird to read Spark configuration via HiveConf
although it's valid here. hiveContext.sparkContext.getConf
might be better.
ok to test |
@@ -28,6 +28,7 @@ import org.apache.spark.annotation.DeveloperApi | |||
import org.apache.spark.sql.hive.HiveContext | |||
import org.apache.spark.sql.hive.thriftserver.ReflectionUtils._ | |||
import org.apache.spark.scheduler.{SparkListenerApplicationEnd, SparkListener} | |||
import org.apache.spark.sql.hive.thriftserver.ui.ThriftServerTab |
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.
Seems that imports are not ordered properly in this file...
Test build #25219 has finished for PR 3946 at commit
|
@@ -184,8 +184,10 @@ private[hive] class SparkExecuteStatementOperation( | |||
} | |||
|
|||
def run(): Unit = { | |||
val sid = UUID.randomUUID().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.
I guess we can use parentSession.getSessionHandle.getSessionId
instead?
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, the listener needs a statement id, not a session id, for updating each statement's state.
@tianyi I understand that because Hive 0.13.1 made incompatible changes to @scwf Would you mind to take a look at this? Particularly the job group related part. |
|
||
import scala.xml.Node | ||
|
||
/** Page for Spark Web UI that shows statistics of a streaming job */ |
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.
streaming job?
I mean I can't match a job and a execution via statement, if there are two same sql running
|
14a461d
to
daed3d1
Compare
rebased from latest master. |
Test build #25735 has finished for PR 3946 at commit
|
Test build #25733 has finished for PR 3946 at commit
|
Test build #25736 has finished for PR 3946 at commit
|
with ReflectedCompositeService { | ||
|
||
private lazy val sparkSqlOperationManager = new SparkSQLOperationManager(hiveContext) | ||
|
||
override def init(hiveConf: HiveConf) { | ||
setSuperField(this, "hiveConf", hiveConf) | ||
|
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.
Remove this empty line.
use statementId as groupId to support multiple jobs for one sql. support multiple jobs for one sql in ThriftServerPage.
Test build #25792 has finished for PR 3946 at commit
|
part of |
Actually the CTRL-C part resides in Beeline. Beeline does implemented a signal handler for this, but the registration code is commented out, don't know why... |
Test build #26085 has finished for PR 3946 at commit
|
ping @liancheng |
Since there is a big difference between this PR and the latest master branch, so I have created a new PR #5730 for this feature. |
This PR is a rebased version of #3946 , and mainly focused on creating an independent tab for the thrift server in spark web UI. Features: 1. Session related statistics ( username and IP are only supported in hive-0.13.1 ) 2. List all the SQL executing or executed on this server 3. Provide links to the job generated by SQL 4. Provide link to show all SQL executing or executed in a specified session Prototype snapshots: This is the main page for thrift server  Author: tianyi <[email protected]> Closes #5730 from tianyi/SPARK-5100 and squashes the following commits: cfd14c7 [tianyi] style fix 0efe3d5 [tianyi] revert part of pom change c0f2fa0 [tianyi] extends HiveThriftJdbcTest to start/stop thriftserver for UI test aa20408 [tianyi] fix style problem c9df6f9 [tianyi] add testsuite for thriftserver ui and fix some style issue 9830199 [tianyi] add webui for thriftserver
This PR is a rebased version of apache#3946 , and mainly focused on creating an independent tab for the thrift server in spark web UI. Features: 1. Session related statistics ( username and IP are only supported in hive-0.13.1 ) 2. List all the SQL executing or executed on this server 3. Provide links to the job generated by SQL 4. Provide link to show all SQL executing or executed in a specified session Prototype snapshots: This is the main page for thrift server  Author: tianyi <[email protected]> Closes apache#5730 from tianyi/SPARK-5100 and squashes the following commits: cfd14c7 [tianyi] style fix 0efe3d5 [tianyi] revert part of pom change c0f2fa0 [tianyi] extends HiveThriftJdbcTest to start/stop thriftserver for UI test aa20408 [tianyi] fix style problem c9df6f9 [tianyi] add testsuite for thriftserver ui and fix some style issue 9830199 [tianyi] add webui for thriftserver
This PR is a rebased version of apache#3946 , and mainly focused on creating an independent tab for the thrift server in spark web UI. Features: 1. Session related statistics ( username and IP are only supported in hive-0.13.1 ) 2. List all the SQL executing or executed on this server 3. Provide links to the job generated by SQL 4. Provide link to show all SQL executing or executed in a specified session Prototype snapshots: This is the main page for thrift server  Author: tianyi <[email protected]> Closes apache#5730 from tianyi/SPARK-5100 and squashes the following commits: cfd14c7 [tianyi] style fix 0efe3d5 [tianyi] revert part of pom change c0f2fa0 [tianyi] extends HiveThriftJdbcTest to start/stop thriftserver for UI test aa20408 [tianyi] fix style problem c9df6f9 [tianyi] add testsuite for thriftserver ui and fix some style issue 9830199 [tianyi] add webui for thriftserver
This PR is a rebased version of apache#3946 , and mainly focused on creating an independent tab for the thrift server in spark web UI. Features: 1. Session related statistics ( username and IP are only supported in hive-0.13.1 ) 2. List all the SQL executing or executed on this server 3. Provide links to the job generated by SQL 4. Provide link to show all SQL executing or executed in a specified session Prototype snapshots: This is the main page for thrift server  Author: tianyi <[email protected]> Closes apache#5730 from tianyi/SPARK-5100 and squashes the following commits: cfd14c7 [tianyi] style fix 0efe3d5 [tianyi] revert part of pom change c0f2fa0 [tianyi] extends HiveThriftJdbcTest to start/stop thriftserver for UI test aa20408 [tianyi] fix style problem c9df6f9 [tianyi] add testsuite for thriftserver ui and fix some style issue 9830199 [tianyi] add webui for thriftserver
In the latest Spark release, there is a Spark Streaming tab on the driver web UI, which shows information about running streaming application. It should be helpful for providing a monitor page in Thrift server because both streaming and Thrift server are long-term applications, and the details of the application do not show on stage page or job page.
Design doc is here: https://issues.apache.org/jira/secure/attachment/12690744/Spark%20Thrift-server%20monitor%20page.pdf
Prototype snapshot: https://issues.apache.org/jira/secure/attachment/12690297/prototype-screenshot.png