You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@yunikorn.apache.org by "PoAn Yang (Jira)" <ji...@apache.org> on 2023/05/30 11:48:00 UTC

[jira] [Created] (YUNIKORN-1772) Simplify the cache Context.SelectApplications function

PoAn Yang created YUNIKORN-1772:
-----------------------------------

             Summary: Simplify the cache Context.SelectApplications function
                 Key: YUNIKORN-1772
                 URL: https://issues.apache.org/jira/browse/YUNIKORN-1772
             Project: Apache YuniKorn
          Issue Type: Improvement
          Components: shim - kubernetes
            Reporter: PoAn Yang
            Assignee: PoAn Yang


In production code, we only use [cache Context.SelectApplications|https://github.com/apache/yunikorn-k8shim/blob/2c502c01f7a116281d94efb250ac4184a371a06a/pkg/cache/context.go#LL928C2-L928C2] in [KubernetesShim.schedule|https://github.com/apache/yunikorn-k8shim/blob/2c502c01f7a116281d94efb250ac4184a371a06a/pkg/shim/scheduler.go#L279] with a {{nil}} filter.

In testing code, [MockScheduler.waitAndAssertApplicationState|https://github.com/apache/yunikorn-k8shim/blob/2c502c01f7a116281d94efb250ac4184a371a06a/pkg/shim/scheduler_mock_test.go#L155-L157] and [MockScheduler.waitAndAssertTaskState|https://github.com/apache/yunikorn-k8shim/blob/2c502c01f7a116281d94efb250ac4184a371a06a/pkg/shim/scheduler_mock_test.go#L193] use it to filter apps by application ID, but this can be replaced by [cache Context.GetApplication|https://github.com/apache/yunikorn-k8shim/blob/2c502c01f7a116281d94efb250ac4184a371a06a/pkg/cache/context.go#L799].

So we can use a new function {{{}GetAllApplications{}}}, and remove SelectApplications in the code base.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: dev-help@yunikorn.apache.org