[SPARK-36611] Remove unused listener in HiveThriftServer2AppStatusStore
### What changes were proposed in this pull request? Remove unused listener in HiveThriftServer2AppStatusStore. ### Why are the changes needed? `HiveThriftServer2AppStatusStore` provides a view of a KVStore with methods that make it easy to query SQL-specific state. `HiveThriftServer2Listener` has no function in this class, and it should not appear in this class. We can remove it. ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? Closes #33866 from timothy65535/master. Authored-by: timothy65535 <timothy65535@163.com> Signed-off-by: Kent Yao <yao@apache.org>
This commit is contained in:
parent
ebe7bb6217
commit
aae7310698
|
@ -73,7 +73,7 @@ object HiveThriftServer2 extends Logging {
|
||||||
listener = new HiveThriftServer2Listener(kvStore, sc.conf, Some(server))
|
listener = new HiveThriftServer2Listener(kvStore, sc.conf, Some(server))
|
||||||
sc.listenerBus.addToStatusQueue(listener)
|
sc.listenerBus.addToStatusQueue(listener)
|
||||||
uiTab = if (sc.getConf.get(UI_ENABLED)) {
|
uiTab = if (sc.getConf.get(UI_ENABLED)) {
|
||||||
Some(new ThriftServerTab(new HiveThriftServer2AppStatusStore(kvStore, Some(listener)),
|
Some(new ThriftServerTab(new HiveThriftServer2AppStatusStore(kvStore),
|
||||||
ThriftServerTab.getSparkUI(sc)))
|
ThriftServerTab.getSparkUI(sc)))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
|
@ -29,9 +29,7 @@ import org.apache.spark.util.kvstore.{KVIndex, KVStore}
|
||||||
* Provides a view of a KVStore with methods that make it easy to query SQL-specific state. There's
|
* Provides a view of a KVStore with methods that make it easy to query SQL-specific state. There's
|
||||||
* no state kept in this class, so it's ok to have multiple instances of it in an application.
|
* no state kept in this class, so it's ok to have multiple instances of it in an application.
|
||||||
*/
|
*/
|
||||||
class HiveThriftServer2AppStatusStore(
|
class HiveThriftServer2AppStatusStore(store: KVStore) {
|
||||||
store: KVStore,
|
|
||||||
val listener: Option[HiveThriftServer2Listener] = None) {
|
|
||||||
|
|
||||||
def getSessionList: Seq[SessionInfo] = {
|
def getSessionList: Seq[SessionInfo] = {
|
||||||
store.view(classOf[SessionInfo]).asScala.toSeq
|
store.view(classOf[SessionInfo]).asScala.toSeq
|
||||||
|
|
|
@ -173,7 +173,7 @@ class HiveThriftServer2ListenerSuite extends SparkFunSuite with BeforeAndAfter {
|
||||||
if (live) {
|
if (live) {
|
||||||
val server = mock(classOf[HiveThriftServer2], RETURNS_SMART_NULLS)
|
val server = mock(classOf[HiveThriftServer2], RETURNS_SMART_NULLS)
|
||||||
val listener = new HiveThriftServer2Listener(kvstore, sparkConf, Some(server))
|
val listener = new HiveThriftServer2Listener(kvstore, sparkConf, Some(server))
|
||||||
(new HiveThriftServer2AppStatusStore(kvstore, Some(listener)), listener)
|
(new HiveThriftServer2AppStatusStore(kvstore), listener)
|
||||||
} else {
|
} else {
|
||||||
(new HiveThriftServer2AppStatusStore(kvstore),
|
(new HiveThriftServer2AppStatusStore(kvstore),
|
||||||
new HiveThriftServer2Listener(kvstore, sparkConf, None, false))
|
new HiveThriftServer2Listener(kvstore, sparkConf, None, false))
|
||||||
|
|
|
@ -50,7 +50,7 @@ class ThriftServerPageSuite extends SparkFunSuite with BeforeAndAfter {
|
||||||
val sparkConf = new SparkConf
|
val sparkConf = new SparkConf
|
||||||
|
|
||||||
val listener = new HiveThriftServer2Listener(kvstore, sparkConf, Some(server))
|
val listener = new HiveThriftServer2Listener(kvstore, sparkConf, Some(server))
|
||||||
val statusStore = new HiveThriftServer2AppStatusStore(kvstore, Some(listener))
|
val statusStore = new HiveThriftServer2AppStatusStore(kvstore)
|
||||||
|
|
||||||
listener.onOtherEvent(SparkListenerThriftServerSessionCreated("localhost", "sessionid", "user",
|
listener.onOtherEvent(SparkListenerThriftServerSessionCreated("localhost", "sessionid", "user",
|
||||||
System.currentTimeMillis()))
|
System.currentTimeMillis()))
|
||||||
|
|
Loading…
Reference in a new issue