Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
8b56400
Add new module and add v11 thrift protocol
AngersZhuuuu Oct 22, 2019
e30f686
add pom lincense
AngersZhuuuu Oct 23, 2019
4a50bc9
update code folder name
AngersZhuuuu Oct 23, 2019
7ffdc3b
all like hive
AngersZhuuuu Oct 23, 2019
b74d5e0
remove py/cpp/r/php
AngersZhuuuu Oct 23, 2019
fc2648f
Maven generate thrift source code
wangyum Oct 24, 2019
5365dcf
org.apache.thrift.tools:maven-thrift-plugin -> org.apache.thrift:thri…
wangyum Oct 25, 2019
95d8137
save some basic code
AngersZhuuuu Oct 26, 2019
4dc5c7e
Merge pull request #2 from wangyum/SPARK-29108
AngersZhuuuu Oct 27, 2019
24ce6d4
Merge branch 'SPARK-29018-V11' of https://github.com/AngersZhuuuu/spa…
AngersZhuuuu Oct 27, 2019
5efe8cb
Revert "save some basic code"
AngersZhuuuu Oct 27, 2019
6f7d48a
Update TCLIService.thrift
AngersZhuuuu Oct 27, 2019
cf24306
Add basic data
AngersZhuuuu Oct 27, 2019
24fce6b
save code
AngersZhuuuu Oct 28, 2019
bc36bdf
change
AngersZhuuuu Oct 28, 2019
c438673
format code
AngersZhuuuu Oct 28, 2019
a7ec8b0
format code
AngersZhuuuu Oct 29, 2019
5cf7eb0
Update SparkSQLEnv.scala
AngersZhuuuu Oct 29, 2019
0023bcb
fix logger conflict
AngersZhuuuu Oct 29, 2019
723450b
fix scala style
AngersZhuuuu Oct 29, 2019
3eb7672
start with execution hive
AngersZhuuuu Oct 29, 2019
5aa4d9d
format code add file header
AngersZhuuuu Oct 29, 2019
782d36b
FOR BUILD spark-thriftserver
AngersZhuuuu Oct 29, 2019
f2b5346
add UT class
AngersZhuuuu Oct 29, 2019
a14a9e9
fix UT case, remove can't supported UT
AngersZhuuuu Oct 29, 2019
e1bb6e1
fix for UT
AngersZhuuuu Oct 29, 2019
74fb240
fix UT
AngersZhuuuu Oct 29, 2019
2f90ed9
fix for UT
AngersZhuuuu Oct 30, 2019
cd92f3f
fix return error
AngersZhuuuu Oct 30, 2019
60dc24f
fix client convert row map
AngersZhuuuu Oct 30, 2019
409a1a3
add UT of TCLIServiceClient
AngersZhuuuu Oct 31, 2019
5771a9b
fix java code style
AngersZhuuuu Oct 31, 2019
77578c3
add processGlobalInitFile
AngersZhuuuu Oct 31, 2019
4f7cbac
Update ThriftServerSessionImpl.scala
AngersZhuuuu Oct 31, 2019
d93ab72
Keep type in scala and remove unused type
AngersZhuuuu Oct 31, 2019
ac9ad54
basic service to java
AngersZhuuuu Oct 31, 2019
795ada1
Handle to java
AngersZhuuuu Oct 31, 2019
63076d3
Operation Type State Status to java
AngersZhuuuu Oct 31, 2019
000443a
Fetch type and orientation to java
AngersZhuuuu Oct 31, 2019
5de2bf9
PatternOrIdentifier to java
AngersZhuuuu Oct 31, 2019
a6b0ed1
Interface to Java
AngersZhuuuu Oct 31, 2019
2e6d221
fix bug
AngersZhuuuu Nov 1, 2019
158b298
remove setApplicationName
AngersZhuuuu Nov 1, 2019
745ca60
Session Basic Class to java
AngersZhuuuu Nov 1, 2019
f62e577
auth and thrift service to java
AngersZhuuuu Nov 1, 2019
5fae842
Update ColumnBasedSet.scala
AngersZhuuuu Nov 1, 2019
fe39db0
Update RowBasedSet.scala
AngersZhuuuu Nov 1, 2019
1c303ba
Update type map
AngersZhuuuu Nov 1, 2019
9a32af8
make RowSetFactory clean
AngersZhuuuu Nov 1, 2019
287c6be
update
AngersZhuuuu Nov 2, 2019
f6a7736
format code
AngersZhuuuu Nov 2, 2019
f8b7351
add thrift file
AngersZhuuuu Nov 6, 2019
272ba3c
not check current java code now
AngersZhuuuu Nov 6, 2019
0de3191
remove import jdk.tools dependency
AngersZhuuuu Nov 6, 2019
6374f42
follow comment
AngersZhuuuu Nov 6, 2019
f464773
Merge branch 'master' into SPARK-29018-V11-STEP4-ADD-TEST
AngersZhuuuu Nov 7, 2019
13da926
fix for `mvn install`
AngersZhuuuu Nov 7, 2019
d0de49f
fix for `mvn install`
AngersZhuuuu Nov 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
save code
  • Loading branch information
AngersZhuuuu committed Oct 28, 2019
commit 24fce6bb934e0dbbc7ed5b5faa68a68bf26675c8
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package org.apache.spark.sql.thriftserver

import java.util.concurrent.atomic.AtomicBoolean

import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer

Expand All @@ -43,19 +41,19 @@ import org.apache.spark.util.{ShutdownHookManager, Utils}
*/
object SparkThriftServer2 extends Logging {
var uiTab: Option[ThriftServerTab] = None
var listener: SparkThriftServer2Listener = _
var listener: SparkThriftServerListener = _

/**
* :: DeveloperApi ::
* Starts a new thrift server with the given context.
*/
@DeveloperApi
def startWithContext(sqlContext: SQLContext): SparkThriftServer2 = {
val server = new SparkThriftServer2(sqlContext)
def startWithContext(sqlContext: SQLContext): SparkThriftServer = {
val server = new SparkThriftServer(sqlContext)

server.init(new HiveConf())
server.start()
listener = new SparkThriftServer2Listener(server, sqlContext.conf)
listener = new SparkThriftServerListener(server, sqlContext.conf)
sqlContext.sparkContext.addSparkListener(listener)
uiTab = if (sqlContext.sparkContext.getConf.get(UI_ENABLED)) {
Some(new ThriftServerTab(sqlContext.sparkContext))
Expand Down Expand Up @@ -86,11 +84,11 @@ object SparkThriftServer2 extends Logging {
}

try {
val server = new SparkThriftServer2(SparkSQLEnv.sqlContext)
val server = new SparkThriftServer(SparkSQLEnv.sqlContext)
server.init(new HiveConf())
server.start()
logInfo("HiveThriftServer2 started")
listener = new SparkThriftServer2Listener(server, SparkSQLEnv.sqlContext.conf)
listener = new SparkThriftServerListener(server, SparkSQLEnv.sqlContext.conf)
SparkSQLEnv.sparkContext.addSparkListener(listener)
uiTab = if (SparkSQLEnv.sparkContext.getConf.get(UI_ENABLED)) {
Some(new ThriftServerTab(SparkSQLEnv.sparkContext))
Expand Down Expand Up @@ -159,8 +157,8 @@ object SparkThriftServer2 extends Logging {
/**
* An inner sparkListener called in sc.stop to clean up the HiveThriftServer2
*/
private[thriftserver] class SparkThriftServer2Listener(val server: SparkThriftServer,
val conf: SQLConf) extends SparkListener {
private[thriftserver] class SparkThriftServerListener(val server: SparkThriftServer,
val conf: SQLConf) extends SparkListener {

override def onApplicationEnd(applicationEnd: SparkListenerApplicationEnd): Unit = {
server.stop()
Expand Down Expand Up @@ -290,27 +288,4 @@ object SparkThriftServer2 extends Logging {

}
}

}

private[thriftserver] class SparkThriftServer2(sqlContext: SQLContext)
extends SparkThriftServer(sqlContext) {
// state is tracked internally so that the server only attempts to shut down if it successfully
// started, and then once only.
private val started = new AtomicBoolean(false)

override def init(hiveConf: HiveConf) {
super.init(hiveConf)
}

override def start(): Unit = {
super.start()
started.set(true)
}

override def stop(): Unit = {
if (started.getAndSet(false)) {
super.stop()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.spark.sql.thriftserver.server

import java.util
import java.util.concurrent.atomic.AtomicBoolean

import scala.collection.JavaConverters._

Expand All @@ -37,6 +38,10 @@ class SparkThriftServer(sqlContext: SQLContext)
extends CompositeService(classOf[SparkThriftServer].getSimpleName)
with Logging {

// state is tracked internally so that the server only attempts to shut down if it successfully
// started, and then once only.
private val started = new AtomicBoolean(false)

private var cliService: CLIService = null
private var thriftCLIService: ThriftCLIService = null

Expand Down Expand Up @@ -75,11 +80,14 @@ class SparkThriftServer(sqlContext: SQLContext)

override def start(): Unit = {
super.start()
started.set(true)
}

override def stop(): Unit = {
logInfo("Shutting down HiveServer2")
super.stop()
if (started.getAndSet(false)) {
logInfo("Shutting down HiveServer2")
super.stop()
}
}
}

Expand Down