You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2022/11/30 13:11:17 UTC

[GitHub] [yunikorn-core] manirajv06 opened a new pull request, #460: [YUNIKORN-1330] Expose REST API's

manirajv06 opened a new pull request, #460:
URL: https://github.com/apache/yunikorn-core/pull/460

   ### What is this PR for?
   Exposing REST API's to fetch the users and groups resource usage
   
   
   ### What type of PR is it?
   * [ ] - Improvement
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/YUNIKORN-1330
   
   ### How should this be tested?
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * [ ] - The licenses files need update.
   * [ ] - There is breaking changes for older versions.
   * [ ] - It needs documentation.
   


-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-core] codecov[bot] commented on pull request #460: [YUNIKORN-1330] Expose REST API's

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #460:
URL: https://github.com/apache/yunikorn-core/pull/460#issuecomment-1332151108

   # [Codecov](https://codecov.io/gh/apache/yunikorn-core/pull/460?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 [#460](https://codecov.io/gh/apache/yunikorn-core/pull/460?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ee8c73b) into [master](https://codecov.io/gh/apache/yunikorn-core/commit/9b90e8ad9f834868971b36cd69284a03532de999?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9b90e8a) will **decrease** coverage by `0.20%`.
   > The diff coverage is `6.66%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #460      +/-   ##
   ==========================================
   - Coverage   72.81%   72.60%   -0.21%     
   ==========================================
     Files          67       67              
     Lines        9990    10018      +28     
   ==========================================
     Hits         7274     7274              
   - Misses       2474     2502      +28     
     Partials      242      242              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/yunikorn-core/pull/460?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [pkg/webservice/handlers.go](https://codecov.io/gh/apache/yunikorn-core/pull/460/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-cGtnL3dlYnNlcnZpY2UvaGFuZGxlcnMuZ28=) | `76.03% <0.00%> (-2.60%)` | :arrow_down: |
   | [pkg/scheduler/ugm/group\_tracker.go](https://codecov.io/gh/apache/yunikorn-core/pull/460/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-cGtnL3NjaGVkdWxlci91Z20vZ3JvdXBfdHJhY2tlci5nbw==) | `90.00% <20.00%> (-10.00%)` | :arrow_down: |
   | [pkg/scheduler/ugm/user\_tracker.go](https://codecov.io/gh/apache/yunikorn-core/pull/460/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-cGtnL3NjaGVkdWxlci91Z20vdXNlcl90cmFja2VyLmdv) | `91.83% <20.00%> (-8.17%)` | :arrow_down: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-core] manirajv06 commented on pull request #460: [YUNIKORN-1330] Expose REST API's

Posted by GitBox <gi...@apache.org>.
manirajv06 commented on PR #460:
URL: https://github.com/apache/yunikorn-core/pull/460#issuecomment-1333396335

   @wilfred-s Patch test coverage is 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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-core] wilfred-s commented on a diff in pull request #460: [YUNIKORN-1330] Expose REST API's

Posted by GitBox <gi...@apache.org>.
wilfred-s commented on code in PR #460:
URL: https://github.com/apache/yunikorn-core/pull/460#discussion_r1036632248


##########
pkg/scheduler/ugm/group_tracker.go:
##########
@@ -65,7 +65,13 @@ func (gt *GroupTracker) getTrackedApplications() map[string]bool {
 	return gt.applications
 }
 
-func (gt *GroupTracker) getGroupResourceUsageDAOInfo(queueTracker *QueueTracker) *dao.GroupResourceUsageDAOInfo {
+func (gt *GroupTracker) GetGroupRootQueueTracker() *QueueTracker {
+	gt.RLock()
+	defer gt.RUnlock()
+	return gt.queueTracker
+}
+
+func (gt *GroupTracker) GetGroupResourceUsageDAOInfo(queueTracker *QueueTracker) *dao.GroupResourceUsageDAOInfo {

Review Comment:
   We do not use `queueTracker` and should not pass it in.



##########
pkg/scheduler/ugm/user_tracker.go:
##########
@@ -84,7 +84,13 @@ func (ut *UserTracker) getTrackedApplications() map[string]*GroupTracker {
 	return ut.appGroupTrackers
 }
 
-func (ut *UserTracker) getUserResourceUsageDAOInfo(queueTracker *QueueTracker) *dao.UserResourceUsageDAOInfo {
+func (ut *UserTracker) GetUserRootQueueTracker() *QueueTracker {
+	ut.RLock()
+	defer ut.RUnlock()
+	return ut.queueTracker
+}

Review Comment:
   Exposing the queue outside of its context is dangerous.
   We must not do this.



##########
pkg/scheduler/ugm/group_tracker.go:
##########
@@ -65,7 +65,13 @@ func (gt *GroupTracker) getTrackedApplications() map[string]bool {
 	return gt.applications
 }
 
-func (gt *GroupTracker) getGroupResourceUsageDAOInfo(queueTracker *QueueTracker) *dao.GroupResourceUsageDAOInfo {
+func (gt *GroupTracker) GetGroupRootQueueTracker() *QueueTracker {
+	gt.RLock()
+	defer gt.RUnlock()
+	return gt.queueTracker
+}

Review Comment:
   Exposing the queue outside of its context is dangerous.
   We must not do this.



##########
pkg/scheduler/ugm/user_tracker.go:
##########
@@ -84,7 +84,13 @@ func (ut *UserTracker) getTrackedApplications() map[string]*GroupTracker {
 	return ut.appGroupTrackers
 }
 
-func (ut *UserTracker) getUserResourceUsageDAOInfo(queueTracker *QueueTracker) *dao.UserResourceUsageDAOInfo {
+func (ut *UserTracker) GetUserRootQueueTracker() *QueueTracker {
+	ut.RLock()
+	defer ut.RUnlock()
+	return ut.queueTracker
+}
+
+func (ut *UserTracker) GetUserResourceUsageDAOInfo(queueTracker *QueueTracker) *dao.UserResourceUsageDAOInfo {

Review Comment:
   We do not use `queueTracker` and should not pass it in.



-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-core] wilfred-s closed pull request #460: [YUNIKORN-1330] Expose REST API's

Posted by GitBox <gi...@apache.org>.
wilfred-s closed pull request #460: [YUNIKORN-1330] Expose REST API's
URL: https://github.com/apache/yunikorn-core/pull/460


-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org