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/05/07 05:41:12 UTC

[GitHub] [incubator-kyuubi] ulysses-you commented on a diff in pull request #2583: [KYUUBI #2375][FOLLOWUP] Implement BatchesResource GET /batches

ulysses-you commented on code in PR #2583:
URL: https://github.com/apache/incubator-kyuubi/pull/2583#discussion_r867307694


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -157,8 +157,9 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
 
   def getBatchSessionList(batchType: String, from: Int, size: Int): Seq[Session] = {
     allSessions().filter {
-      case batchSession: KyuubiBatchSessionImpl =>
+      case batchSession: KyuubiBatchSessionImpl if batchType != null =>
         batchSession.batchJobSubmissionOp.batchType.equalsIgnoreCase(batchType)
+      case _: KyuubiBatchSessionImpl => true
       case _ => false
     }.toSeq.sortBy(_.handle.identifier.toString).slice(from, from + size)

Review Comment:
   we can pull out the condition:
   
   ```
   val sessions = if (isnull) all else ...
   session.toSeq.sortBy..
   ```



-- 
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