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/04/30 07:02:39 UTC

[GitHub] [incubator-kyuubi] turboFei opened a new pull request, #2528: [SUB-TASK][KPIP-4] Implement BatchesResource DELETE /batches/${batchId}

turboFei opened a new pull request, #2528:
URL: https://github.com/apache/incubator-kyuubi/pull/2528

   <!--
   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.
   -->
   
   
   ### _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] turboFei commented on a diff in pull request #2528: [KYUUBI #2379][SUB-TASK][KPIP-4] Implement BatchesResource DELETE /batches/${batchId}

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


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala:
##########
@@ -63,6 +65,43 @@ private[v1] class BatchesResource extends ApiRequestContext with Logging {
       fe.connectionUrl,
       batchOp.getStatus.state.toString)
   }
+
+  @ApiResponse(
+    responseCode = "200",
+    content = Array(new Content(
+      mediaType = MediaType.APPLICATION_JSON)),
+    description = "close a batch session")
+  @DELETE
+  @Path("{batchId}")
+  def closeBatchSession(
+      @PathParam("batchId") batchId: String,
+      @QueryParam("killApp") killApp: Boolean): Response = {
+    var session: KyuubiBatchSessionImpl = null
+    try {
+      val sessionHandle = sessionManager.getBatchSessionHandle(batchId, REST_BATCH_PROTOCOL)
+      session = sessionManager.getSession(sessionHandle).asInstanceOf[KyuubiBatchSessionImpl]
+    } catch {
+      case NonFatal(e) =>
+        error(s"Invalid batchId: $batchId", e)
+        throw new NotFoundException(s"Invalid batchId: $batchId")
+    }
+
+    // TODO: Support proxy user

Review Comment:
   created #2556



-- 
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 #2528: [KYUUBI #2379][SUB-TASK][KPIP-4] Implement BatchesResource DELETE /batches/${batchId}

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

   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528?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 [#2528](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (559b8ed) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/cdfae8d879194a355fdaa03dc33f23578d897402?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cdfae8d) will **decrease** coverage by `0.02%`.
   > The diff coverage is `83.33%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2528      +/-   ##
   ============================================
   - Coverage     63.63%   63.61%   -0.03%     
     Complexity       41       41              
   ============================================
     Files           373      373              
     Lines         17829    17841      +12     
     Branches       2378     2380       +2     
   ============================================
   + Hits          11345    11349       +4     
   - Misses         5430     5433       +3     
   - Partials       1054     1059       +5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../apache/kyuubi/server/api/v1/BatchesResource.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528/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-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2ZXIvYXBpL3YxL0JhdGNoZXNSZXNvdXJjZS5zY2FsYQ==) | `93.54% <80.00%> (-6.46%)` | :arrow_down: |
   | [...g/apache/kyuubi/operation/BatchJobSubmission.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528/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-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vQmF0Y2hKb2JTdWJtaXNzaW9uLnNjYWxh) | `83.56% <100.00%> (+0.22%)` | :arrow_up: |
   | [...g/apache/kyuubi/session/KyuubiSessionManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528/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) | `86.48% <100.00%> (+0.18%)` | :arrow_up: |
   | [...rg/apache/kyuubi/engine/trino/TrinoSqlEngine.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528/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-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3FsRW5naW5lLnNjYWxh) | `52.63% <0.00%> (-7.02%)` | :arrow_down: |
   | [...ache/kyuubi/operation/KyuubiOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528/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-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uTWFuYWdlci5zY2FsYQ==) | `83.60% <0.00%> (-1.64%)` | :arrow_down: |
   | [.../engine/spark/session/SparkSQLSessionManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528/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-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9zZXNzaW9uL1NwYXJrU1FMU2Vzc2lvbk1hbmFnZXIuc2NhbGE=) | `79.76% <0.00%> (-1.20%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [cdfae8d...559b8ed](https://codecov.io/gh/apache/incubator-kyuubi/pull/2528?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] ulysses-you commented on a diff in pull request #2528: [KYUUBI #2379][SUB-TASK][KPIP-4] Implement BatchesResource DELETE /batches/${batchId}

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


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala:
##########
@@ -63,6 +65,43 @@ private[v1] class BatchesResource extends ApiRequestContext with Logging {
       fe.connectionUrl,
       batchOp.getStatus.state.toString)
   }
+
+  @ApiResponse(
+    responseCode = "200",
+    content = Array(new Content(
+      mediaType = MediaType.APPLICATION_JSON)),
+    description = "close a batch session")
+  @DELETE
+  @Path("{batchId}")
+  def closeBatchSession(
+      @PathParam("batchId") batchId: String,
+      @QueryParam("killApp") killApp: Boolean): Response = {
+    var session: KyuubiBatchSessionImpl = null
+    try {
+      val sessionHandle = sessionManager.getBatchSessionHandle(batchId, REST_BATCH_PROTOCOL)
+      session = sessionManager.getSession(sessionHandle).asInstanceOf[KyuubiBatchSessionImpl]
+    } catch {
+      case NonFatal(e) =>
+        error(s"Invalid batchId: $batchId", e)
+        throw new NotFoundException(s"Invalid batchId: $batchId")
+    }
+
+    // TODO: Support proxy user

Review Comment:
   can it be `hive.server2.proxy.user` ?



-- 
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 a diff in pull request #2528: [KYUUBI #2379][SUB-TASK][KPIP-4] Implement BatchesResource DELETE /batches/${batchId}

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


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala:
##########
@@ -63,6 +65,43 @@ private[v1] class BatchesResource extends ApiRequestContext with Logging {
       fe.connectionUrl,
       batchOp.getStatus.state.toString)
   }
+
+  @ApiResponse(
+    responseCode = "200",
+    content = Array(new Content(
+      mediaType = MediaType.APPLICATION_JSON)),
+    description = "close a batch session")
+  @DELETE
+  @Path("{batchId}")
+  def closeBatchSession(
+      @PathParam("batchId") batchId: String,
+      @QueryParam("killApp") killApp: Boolean): Response = {
+    var session: KyuubiBatchSessionImpl = null
+    try {
+      val sessionHandle = sessionManager.getBatchSessionHandle(batchId, REST_BATCH_PROTOCOL)
+      session = sessionManager.getSession(sessionHandle).asInstanceOf[KyuubiBatchSessionImpl]
+    } catch {
+      case NonFatal(e) =>
+        error(s"Invalid batchId: $batchId", e)
+        throw new NotFoundException(s"Invalid batchId: $batchId")
+    }
+
+    // TODO: Support proxy user

Review Comment:
   sounds good.



-- 
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 #2528: [KYUUBI #2379][SUB-TASK][KPIP-4] Implement BatchesResource DELETE /batches/${batchId}

Posted by GitBox <gi...@apache.org>.
ulysses-you closed pull request #2528: [KYUUBI #2379][SUB-TASK][KPIP-4] Implement BatchesResource DELETE /batches/${batchId}
URL: https://github.com/apache/incubator-kyuubi/pull/2528


-- 
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 #2528: [KYUUBI #2379][SUB-TASK][KPIP-4] Implement BatchesResource DELETE /batches/${batchId}

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

   need verify the permission to kill job


-- 
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 #2528: [KYUUBI #2379][SUB-TASK][KPIP-4] Implement BatchesResource DELETE /batches/${batchId}

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


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala:
##########
@@ -63,6 +65,43 @@ private[v1] class BatchesResource extends ApiRequestContext with Logging {
       fe.connectionUrl,
       batchOp.getStatus.state.toString)
   }
+
+  @ApiResponse(
+    responseCode = "200",
+    content = Array(new Content(
+      mediaType = MediaType.APPLICATION_JSON)),
+    description = "close a batch session")
+  @DELETE
+  @Path("{batchId}")
+  def closeBatchSession(
+      @PathParam("batchId") batchId: String,
+      @QueryParam("killApp") killApp: Boolean): Response = {
+    var session: KyuubiBatchSessionImpl = null
+    try {
+      val sessionHandle = sessionManager.getBatchSessionHandle(batchId, REST_BATCH_PROTOCOL)
+      session = sessionManager.getSession(sessionHandle).asInstanceOf[KyuubiBatchSessionImpl]
+    } catch {
+      case NonFatal(e) =>
+        error(s"Invalid batchId: $batchId", e)
+        throw new NotFoundException(s"Invalid batchId: $batchId")
+    }
+
+    // TODO: Support proxy user

Review Comment:
   is there a ticket for this todo ?



-- 
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 a diff in pull request #2528: [KYUUBI #2379][SUB-TASK][KPIP-4] Implement BatchesResource DELETE /batches/${batchId}

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


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala:
##########
@@ -63,6 +65,43 @@ private[v1] class BatchesResource extends ApiRequestContext with Logging {
       fe.connectionUrl,
       batchOp.getStatus.state.toString)
   }
+
+  @ApiResponse(
+    responseCode = "200",
+    content = Array(new Content(
+      mediaType = MediaType.APPLICATION_JSON)),
+    description = "close a batch session")
+  @DELETE
+  @Path("{batchId}")
+  def closeBatchSession(
+      @PathParam("batchId") batchId: String,
+      @QueryParam("killApp") killApp: Boolean): Response = {
+    var session: KyuubiBatchSessionImpl = null
+    try {
+      val sessionHandle = sessionManager.getBatchSessionHandle(batchId, REST_BATCH_PROTOCOL)
+      session = sessionManager.getSession(sessionHandle).asInstanceOf[KyuubiBatchSessionImpl]
+    } catch {
+      case NonFatal(e) =>
+        error(s"Invalid batchId: $batchId", e)
+        throw new NotFoundException(s"Invalid batchId: $batchId")
+    }
+
+    // TODO: Support proxy user

Review Comment:
   How about?
   ```
         @PathParam("batchId") batchId: String,
         @QueryParam("killApp") killApp: Boolean,
         @QueryParam("proxyUser") proxyUser: String): Response = {
   ```



##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala:
##########
@@ -63,6 +65,43 @@ private[v1] class BatchesResource extends ApiRequestContext with Logging {
       fe.connectionUrl,
       batchOp.getStatus.state.toString)
   }
+
+  @ApiResponse(
+    responseCode = "200",
+    content = Array(new Content(
+      mediaType = MediaType.APPLICATION_JSON)),
+    description = "close a batch session")
+  @DELETE
+  @Path("{batchId}")
+  def closeBatchSession(
+      @PathParam("batchId") batchId: String,
+      @QueryParam("killApp") killApp: Boolean): Response = {
+    var session: KyuubiBatchSessionImpl = null
+    try {
+      val sessionHandle = sessionManager.getBatchSessionHandle(batchId, REST_BATCH_PROTOCOL)
+      session = sessionManager.getSession(sessionHandle).asInstanceOf[KyuubiBatchSessionImpl]
+    } catch {
+      case NonFatal(e) =>
+        error(s"Invalid batchId: $batchId", e)
+        throw new NotFoundException(s"Invalid batchId: $batchId")
+    }
+
+    // TODO: Support proxy user

Review Comment:
   cc @ulysses-you 



-- 
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 #2528: [KYUUBI #2379][SUB-TASK][KPIP-4] Implement BatchesResource DELETE /batches/${batchId}

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

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