[KYUUBI #1032][FOLLOWUP] Refine session hande in AbstractSession

<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
Remove session hande in `AbstractSession`

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1046 from ulysses-you/kyuubi-1032-f.

Closes #1032

1d7543a9 [ulysses-you] order
36a0a1cc [ulysses-you] refine

Authored-by: ulysses-you <ulyssesyou18@gmail.com>
Signed-off-by: ulysses-you <ulyssesyou18@gmail.com>
This commit is contained in:
ulysses-you 2021-09-07 12:08:09 +08:00
parent 347c932768
commit 59d9f06a46
3 changed files with 3 additions and 5 deletions

View File

@ -21,7 +21,7 @@ import org.apache.hive.service.rpc.thrift.TProtocolVersion
import org.apache.kyuubi.engine.spark.events.{EventLoggingService, SessionEvent}
import org.apache.kyuubi.operation.{Operation, OperationHandle}
import org.apache.kyuubi.session.{AbstractSession, SessionManager}
import org.apache.kyuubi.session.{AbstractSession, SessionHandle, SessionManager}
class SparkSessionImpl(
protocol: TProtocolVersion,
@ -31,6 +31,7 @@ class SparkSessionImpl(
conf: Map[String, String],
sessionManager: SessionManager)
extends AbstractSession(protocol, user, password, ipAddress, conf, sessionManager) {
override val handle: SessionHandle = SessionHandle(protocol)
private val sessionEvent = SessionEvent(this)

View File

@ -36,9 +36,6 @@ abstract class AbstractSession(
protected def logSessionInfo(msg: String): Unit = info(s"[$user:$ipAddress] $handle - $msg")
private final val _handle: SessionHandle = SessionHandle(protocol)
override def handle: SessionHandle = _handle
private final val _createTime: Long = System.currentTimeMillis()
override def createTime: Long = _createTime

View File

@ -27,6 +27,6 @@ class NoopSessionImpl(
conf: Map[String, String],
sessionManager: SessionManager)
extends AbstractSession(protocol, user, password, ipAddress, conf, sessionManager) {
override lazy val handle: SessionHandle = SessionHandle(protocol)
override def open(): Unit = {}
}