You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/07/25 07:37:39 UTC

[GitHub] [incubator-kyuubi] ulysses-you opened a new pull request, #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

ulysses-you opened a new pull request, #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134

   <!--
   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.
   -->
   metadata manager is only used for batch session for rest frontend.
   
   ### _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.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#issuecomment-1195030030

   
   this.conf = conf


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r928686093


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -45,14 +45,22 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
   // this lazy is must be specified since the conf is null when the class initialization
   lazy val sessionConfAdvisor: SessionConfAdvisor = PluginLoader.loadSessionConfAdvisor(conf)
   val applicationManager = new KyuubiApplicationManager()
-  private val metadataManager = new MetadataManager()
+  private var metadataManagerOpt: Option[MetadataManager] = None
 
   private var limiter: Option[SessionLimiter] = None
 
   override def initialize(conf: KyuubiConf): Unit = {
     addService(applicationManager)
     addService(credentialsManager)
-    addService(metadataManager)
+
+    // metadata manager is only used for batch session so if frontend does not support rest

Review Comment:
   Currently, the metadata manager is used by the REST frontend which provides batch job APIs, so we initialize it only when Kyuubi starts with the REST frontend.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r928682418


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -166,23 +174,33 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
   }
 
   def insertMetadata(metadata: Metadata): Unit = {
-    metadataManager.insertMetadata(metadata)
+    metadataManagerOpt.foreach { metadataManager =>

Review Comment:
   metadataManager.foreach(_.insertMetadata(metadata))



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
turboFei commented on PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#issuecomment-1194064331

   ```
   FlinkOperationSuite:
   org.apache.kyuubi.it.flink.operation.FlinkOperationSuite *** ABORTED ***
     java.lang.NullPointerException:
     at org.apache.kyuubi.session.KyuubiSessionManager.metadataManager$lzycompute(KyuubiSessionManager.scala:51)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r928586941


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -165,6 +173,11 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
     getSessionOption(sessionHandle).map(_.asInstanceOf[KyuubiBatchSessionImpl]).orNull
   }
 
+  private def metadataManager: MetadataManager = {

Review Comment:
   we can use metadataManager.foreach for all operations



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r928655712


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -165,6 +173,11 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
     getSessionOption(sessionHandle).map(_.asInstanceOf[KyuubiBatchSessionImpl]).orNull
   }
 
+  private def metadataManager: MetadataManager = {

Review Comment:
   changed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#issuecomment-1196222338

   test passed ! cc @turboFei @yaooqinn 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r932832389


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -193,16 +204,18 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
       endTime: Long,
       from: Int,
       size: Int): Seq[Batch] = {
-    metadataManager.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size)
+    metadataManager.map(
+      _.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size))
+      .orNull

Review Comment:
   @yaooqinn  it's ok now



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r930594388


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -193,16 +204,18 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
       endTime: Long,
       from: Int,
       size: Int): Seq[Batch] = {
-    metadataManager.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size)
+    metadataManager.map(
+      _.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size))
+      .orNull

Review Comment:
   I just follow the semantics of original code, the test will fail if change to Seq.empty.. I do not want to do more change in this pr so use `orNull`.
   
   cc @turboFei 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r932061562


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -193,16 +204,18 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
       endTime: Long,
       from: Int,
       size: Int): Seq[Batch] = {
-    metadataManager.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size)
+    metadataManager.map(
+      _.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size))
+      .orNull

Review Comment:
   which is the failed test 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r928681312


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -45,14 +45,22 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
   // this lazy is must be specified since the conf is null when the class initialization
   lazy val sessionConfAdvisor: SessionConfAdvisor = PluginLoader.loadSessionConfAdvisor(conf)
   val applicationManager = new KyuubiApplicationManager()
-  private val metadataManager = new MetadataManager()
+  private var metadataManagerOpt: Option[MetadataManager] = None

Review Comment:
   ```suggestion
     private lazy val metadataManager: Option[MetadataManager] = {
       // metadata manager is only used for batch session so if frontend does not support rest
       // it's unused.
       if (conf.get(FRONTEND_PROTOCOLS).map(FrontendProtocols.withName)
         .contains(FrontendProtocols.REST)) {
         Some(new MetadataManager())
       } else {
         None
       }
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r930585465


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -45,14 +45,25 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
   // this lazy is must be specified since the conf is null when the class initialization
   lazy val sessionConfAdvisor: SessionConfAdvisor = PluginLoader.loadSessionConfAdvisor(conf)
   val applicationManager = new KyuubiApplicationManager()
-  private val metadataManager = new MetadataManager()
+  private lazy val metadataManager: Option[MetadataManager] = {
+    // Currently, the metadata manager is used by the REST frontend which provides batch job APIs,
+    // so we initialize it only when Kyuubi starts with the REST frontend.
+    if (conf.get(FRONTEND_PROTOCOLS).map(FrontendProtocols.withName)
+        .contains(FrontendProtocols.REST)) {
+      Option(new MetadataManager())
+    } else {
+      None
+    }
+  }
 
   private var limiter: Option[SessionLimiter] = None
 
   override def initialize(conf: KyuubiConf): Unit = {
     addService(applicationManager)
     addService(credentialsManager)
-    addService(metadataManager)
+    this.conf = conf

Review Comment:
   nit: to L62



##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -45,14 +45,25 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
   // this lazy is must be specified since the conf is null when the class initialization
   lazy val sessionConfAdvisor: SessionConfAdvisor = PluginLoader.loadSessionConfAdvisor(conf)
   val applicationManager = new KyuubiApplicationManager()
-  private val metadataManager = new MetadataManager()
+  private lazy val metadataManager: Option[MetadataManager] = {
+    // Currently, the metadata manager is used by the REST frontend which provides batch job APIs,
+    // so we initialize it only when Kyuubi starts with the REST frontend.
+    if (conf.get(FRONTEND_PROTOCOLS).map(FrontendProtocols.withName)
+        .contains(FrontendProtocols.REST)) {
+      Option(new MetadataManager())
+    } else {
+      None
+    }
+  }
 
   private var limiter: Option[SessionLimiter] = None
 
   override def initialize(conf: KyuubiConf): Unit = {
     addService(applicationManager)
     addService(credentialsManager)
-    addService(metadataManager)
+    this.conf = conf
+    metadataManager.foreach(addService)
+

Review Comment:
   nit: remove blank line



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r932061562


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -193,16 +204,18 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
       endTime: Long,
       from: Int,
       size: Int): Seq[Batch] = {
-    metadataManager.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size)
+    metadataManager.map(
+      _.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size))
+      .orNull

Review Comment:
   which is the failed test? the pr only has 26++, it's ok to fix the test 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#issuecomment-1197935980

   @yaooqinn @turboFei any concern for this pr ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#issuecomment-1194879549

   it seems we can not use kyuubi conf until `super.initialize`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#issuecomment-1196209135

   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3134](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5d3eded) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/0b3f6b739d3cd253d97a85e142d1d817ff1f6d8b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0b3f6b7) will **increase** coverage by `0.17%`.
   > The diff coverage is `90.47%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3134      +/-   ##
   ============================================
   + Coverage     51.31%   51.49%   +0.17%     
     Complexity        6        6              
   ============================================
     Files           458      456       -2     
     Lines         25388    25336      -52     
     Branches       3536     3521      -15     
   ============================================
   + Hits          13029    13047      +18     
   + Misses        11115    11046      -69     
   + Partials       1244     1243       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...g/apache/kyuubi/session/KyuubiSessionManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXNzaW9uL0t5dXViaVNlc3Npb25NYW5hZ2VyLnNjYWxh) | `89.65% <90.47%> (-0.16%)` | :arrow_down: |
   | [...main/java/org/apache/kyuubi/jdbc/KyuubiDriver.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhpdmUtamRiYy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUva3l1dWJpL2pkYmMvS3l1dWJpRHJpdmVyLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...org/apache/kyuubi/ha/client/ServiceDiscovery.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL2NsaWVudC9TZXJ2aWNlRGlzY292ZXJ5LnNjYWxh) | `83.33% <0.00%> (-12.50%)` | :arrow_down: |
   | [...g/apache/kyuubi/client/api/v1/dto/VersionInfo.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXJlc3QtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvY2xpZW50L2FwaS92MS9kdG8vVmVyc2lvbkluZm8uamF2YQ==) | `53.84% <0.00%> (-4.49%)` | :arrow_down: |
   | [...apache/kyuubi/client/api/v1/dto/SessionHandle.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXJlc3QtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvY2xpZW50L2FwaS92MS9kdG8vU2Vzc2lvbkhhbmRsZS5qYXZh) | `53.84% <0.00%> (-4.49%)` | :arrow_down: |
   | [...ache/kyuubi/client/api/v1/dto/OpActionRequest.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXJlc3QtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvY2xpZW50L2FwaS92MS9kdG8vT3BBY3Rpb25SZXF1ZXN0LmphdmE=) | `53.84% <0.00%> (-4.49%)` | :arrow_down: |
   | [...che/kyuubi/client/api/v1/dto/SessionOpenCount.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXJlc3QtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvY2xpZW50L2FwaS92MS9kdG8vU2Vzc2lvbk9wZW5Db3VudC5qYXZh) | `53.84% <0.00%> (-4.49%)` | :arrow_down: |
   | [...e/kyuubi/client/api/v1/dto/CloseBatchResponse.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXJlc3QtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvY2xpZW50L2FwaS92MS9kdG8vQ2xvc2VCYXRjaFJlc3BvbnNlLmphdmE=) | `68.42% <0.00%> (-3.81%)` | :arrow_down: |
   | [...ava/org/apache/kyuubi/client/api/v1/dto/Field.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXJlc3QtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvY2xpZW50L2FwaS92MS9kdG8vRmllbGQuamF2YQ==) | `61.11% <0.00%> (-3.60%)` | :arrow_down: |
   | [...rg/apache/kyuubi/client/api/v1/dto/InfoDetail.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXJlc3QtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvY2xpZW50L2FwaS92MS9kdG8vSW5mb0RldGFpbC5qYXZh) | `61.11% <0.00%> (-3.60%)` | :arrow_down: |
   | ... and [48 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/3134/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r928681968


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -45,14 +45,22 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
   // this lazy is must be specified since the conf is null when the class initialization
   lazy val sessionConfAdvisor: SessionConfAdvisor = PluginLoader.loadSessionConfAdvisor(conf)
   val applicationManager = new KyuubiApplicationManager()
-  private val metadataManager = new MetadataManager()
+  private var metadataManagerOpt: Option[MetadataManager] = None
 
   private var limiter: Option[SessionLimiter] = None
 
   override def initialize(conf: KyuubiConf): Unit = {
     addService(applicationManager)
     addService(credentialsManager)
-    addService(metadataManager)
+
+    // metadata manager is only used for batch session so if frontend does not support rest
+    // it's unused.
+    if (conf.get(FRONTEND_PROTOCOLS).map(FrontendProtocols.withName)
+        .contains(FrontendProtocols.REST)) {
+      metadataManagerOpt = Some(new MetadataManager())
+      addService(metadataManagerOpt.get)
+    }
+

Review Comment:
   ```suggestion
      metadataManager.foreach(addService)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r928705133


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -45,14 +45,22 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
   // this lazy is must be specified since the conf is null when the class initialization
   lazy val sessionConfAdvisor: SessionConfAdvisor = PluginLoader.loadSessionConfAdvisor(conf)
   val applicationManager = new KyuubiApplicationManager()
-  private val metadataManager = new MetadataManager()
+  private var metadataManagerOpt: Option[MetadataManager] = None
 
   private var limiter: Option[SessionLimiter] = None
 
   override def initialize(conf: KyuubiConf): Unit = {
     addService(applicationManager)
     addService(credentialsManager)
-    addService(metadataManager)
+
+    // metadata manager is only used for batch session so if frontend does not support rest

Review Comment:
   addressed comments



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r930586255


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -193,16 +204,18 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
       endTime: Long,
       from: Int,
       size: Int): Seq[Batch] = {
-    metadataManager.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size)
+    metadataManager.map(
+      _.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size))
+      .orNull

Review Comment:
   is orNull a good choice, where NPE lurks



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on a diff in pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#discussion_r932170549


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -193,16 +204,18 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
       endTime: Long,
       from: Int,
       size: Int): Seq[Batch] = {
-    metadataManager.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size)
+    metadataManager.map(
+      _.getBatches(batchType, batchUser, batchState, createTime, endTime, from, size))
+      .orNull

Review Comment:
   Not sure which code cause test failed .. I wil try to fix it in this pr



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you closed pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
ulysses-you closed pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest
URL: https://github.com/apache/incubator-kyuubi/pull/3134


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #3134: [KYUUBI #2240][SUB-TASK] Skip add metadata manager if frontend does not support rest

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on PR #3134:
URL: https://github.com/apache/incubator-kyuubi/pull/3134#issuecomment-1198939526

   thank you for review, merging to master


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org