[ 
https://issues.apache.org/jira/browse/YUNIKORN-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17798484#comment-17798484
 ] 

Wilfred Spiegelenburg commented on YUNIKORN-2235:
-------------------------------------------------

The overhead is not that much. The web server will run in its own thread and do 
the processing. However, the way we currently lock to filter the apps takes a 
read lock on the partition. Since we access all applications inside the lock we 
keep it fr a bit longer. The locking stops applications from being removed or 
added at the partition level.

If we want to prevent that it is better to use the call 
{{partition.GetApplications()}} to get a copy of the list and let the partition 
lock go. We can then check all applications outside of the partition lock. The 
performance will not differ much but it keeps the partition lock for a shorter 
amount of time.

The call {{/ws/v1/partition/:partition/applications/active?status=:state}} will 
then consist of the same steps each time:
 * call {{partition.GetApplications()}}
 * if filter is defined: skip processing the applications in the not in the 
requested state
 * add the application DAO to the list

Asking for just one state is probably faster than the whole list as there is 
less data to build and transmit.

For completed and rejected we have less impact as they are just kept for 
display etc. Calling {{/ws/v1/partition/:partition/applications/:state}} will 
just get a copy of either the completed or rejected applications (not filtered) 
and create the DAO for the applications.

We might want to look at special DAOs for those types. Completed applications 
should not show allocations etc. Rejected applications probably should show 
"requestedQueuePath" and not just "queuePath" as the path probably does not 
exist. Tracking rejected applications might need to be improved BTW to make it 
consumable for admins.

> Add new RESTful API for retrieving application
> ----------------------------------------------
>
>                 Key: YUNIKORN-2235
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-2235
>             Project: Apache YuniKorn
>          Issue Type: New Feature
>          Components: core - scheduler
>            Reporter: Xie YiFan
>            Assignee: Xie YiFan
>            Priority: Minor
>              Labels: pull-request-available
>
> *Situation:*
> Currently, the path format of retrieving application is 
> /ws/v1/partition/\{partitionName}/queue/\{queueName}/application/\{appId}.
> We have to give 3 parameters (partitionName, queueName & appID) to fetch 
> application information. But one application can only be submitted to one 
> queue and PartitionContext stores all applications. It means that we can 
> fetch the target application without queue name.
> *Proposal:*
> As we have discussed in slack, we can add the following 2 RESTful API.
>  # /ws/v1/partition/\{partitionName}/applications/\{type} 
> aim to list applications IDs via the types: rejected, running and completed
>  # /ws/v1/partition/\{partitionName}/application/\{applicationID} 
> aim to retrieving one application object directly.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to