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/06 05:47:03 UTC

[GitHub] [incubator-kyuubi] zhaomin1423 commented on a diff in pull request #2567: [KYUUBI #2378] Implement BatchesResource GET /batches/${batchId}/log

zhaomin1423 commented on code in PR #2567:
URL: https://github.com/apache/incubator-kyuubi/pull/2567#discussion_r866506071


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala:
##########
@@ -71,23 +87,38 @@ private[v1] class BatchesResource extends ApiRequestContext with Logging {
   def batchInfo(@PathParam("batchId") batchId: String): Batch = {
     try {
       val sessionHandle = sessionManager.getBatchSessionHandle(batchId, REST_BATCH_PROTOCOL)
-      val session = sessionManager.getSession(sessionHandle).asInstanceOf[KyuubiBatchSessionImpl]
-      buildBatch(session)
+      buildBatch(sessionHandle)
     } catch {
       case NonFatal(e) =>
         error(s"Invalid batchId: $batchId", e)
         throw new NotFoundException(s"Invalid batchId: $batchId")
     }
   }
 
-  private def buildBatch(session: KyuubiBatchSessionImpl): Batch = {
-    val batchOp = session.batchJobSubmissionOp
-    Batch(
-      batchOp.batchId,
-      batchOp.batchType,
-      batchOp.currentApplicationState.getOrElse(Map.empty),
-      fe.connectionUrl,
-      batchOp.getStatus.state.toString)
+  @ApiResponse(
+    responseCode = "200",
+    content = Array(new Content(
+      mediaType = MediaType.APPLICATION_JSON)),
+    description = "get operation log")
+  @GET
+  @Path("{batchId}/log")
+  def getBatchLog(
+      @PathParam("batchId") batchId: String,
+      @QueryParam("maxRows") maxRows: Int): OperationLog = {

Review Comment:
   https://github.com/apache/incubator-kyuubi/discussions/2304



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