pan3793 opened a new pull request, #4790:
URL: https://github.com/apache/kyuubi/pull/4790

   <!--
   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/CONTRIBUTING.html
     2. If the PR is related to an issue in 
https://github.com/apache/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 is it done today, and what are the limits of current practice?
   
   The current procedure of Batch Job API, called as V1
   
   ```mermaid
   sequenceDiagram
   participant Client
   participant Server
   participant Metastore
   participant RM
   
   Client ->> Server : Create Batch Job
   Server ->> Server : Create Batch Operator
   Server ->> Metastore : Persist Job metadata (PENDING)
   Server ->> Server : Put Batch Operator into Execution Pool
   Server ->> Client : Batch Job Info
   Server -x RM : Submit Applicition (async in Execution Pool)
   loop Application Check
       Server ->> RM : Query Application Status
       Server ->> Metastore : Update Batch Status
   end
   
   Client ->> Server : Query Batch Job Info
   alt KyuubiInstance matched
       Server ->> Client : Batch Job Info
   else
       Server ->> Server : Forward Request to expected KyuubiInstance
   end
   
   Client ->> Server : Fetch Batch Job logs
   alt KyuubiInstance matched
       Server ->> Client : Batch Job logs
   else
       Server ->> Server : Forward Request to expected KyuubiInstance
   end
   
   Client ->> Server : Close Batch Job
   alt KyuubiInstance matched
       Server ->> RM : Close the Application
       Server ->> Metastore : Update Batch Status
       Server ->> Client : Closed Batch Job Info
   else
       Server ->> Server : Forward Request to expected KyuubiInstance
   end
   ```
   
   V2
   
   ```mermaid
   sequenceDiagram
   participant Client
   participant Server
   participant Metastore
   participant RM
   
   Client ->> Server : Create Batch Job
   Server ->> Metastore : Persist Job metadata (INITIALIZED)
   Server ->> Client : Batch Job Info
   
   loop Forever
       Server ->> Metastore : Pick up and lock INITIALIZED job
       Server ->> RM : Submit Application
       Server ->> RM : Query Application Status
       Server ->> Metastore : Update Batch Status
   end
   
   Client ->> Server : Query Batch Job Info
   Server ->> Metastore : Query Batch Job Info
   Server ->> Client : Batch Job Info
   
   Client ->> Server : Fetch Batch Job logs
   alt KyuubiInstance matched
       Server ->> Client : Batch Job logs
   else
       Server ->> Server : Forward Request to expected KyuubiInstance
   end
   
   Client ->> Server : Close Batch Job
   alt KyuubiInstance matched
       Server ->> RM : Close the Application
       Server ->> Metastore : Update Batch Status
       Server ->> Client : Closed Batch Job Info
   else
       Server ->> Server : Forward Request to expected KyuubiInstance
   end
   ```
   
   ### _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/master/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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to