zhuqi-lucas commented on code in PR #522:
URL: https://github.com/apache/yunikorn-core/pull/522#discussion_r1148356973
##########
pkg/scheduler/ugm/group_tracker.go:
##########
@@ -78,3 +78,7 @@ func (gt *GroupTracker) GetGroupResourceUsageDAOInfo()
*dao.GroupResourceUsageDA
groupResourceUsage.Queues = gt.queueTracker.getResourceUsageDAOInfo("")
return groupResourceUsage
}
+
+func (gt *GroupTracker) CleanDeletedQueueTracker(queuePath string) {
Review Comment:
Good suggestion, addressed in latest PR.
##########
pkg/scheduler/ugm/manager.go:
##########
@@ -304,6 +304,17 @@ func (m *Manager) cleaner() {
}
}
+func (m *Manager) CleanDeletedQueueTrackers(queuePath string) {
Review Comment:
Good suggestion, addressed in latest PR.
##########
pkg/scheduler/ugm/queue_tracker.go:
##########
@@ -151,3 +151,23 @@ func (qt *QueueTracker)
getResourceUsageDAOInfo(parentQueuePath string) *dao.Res
func (qt *QueueTracker) getRunningApplications() map[string]bool {
return qt.runningApplications
}
+
+func (qt *QueueTracker) cleanQueueTracker(queuePath string) {
+ idx := strings.Index(queuePath, configs.DOT)
+ childQueuePath := ""
+ if idx != -1 {
+ childQueuePath = queuePath[idx+1:]
+ }
+ childIndex := strings.Index(childQueuePath, configs.DOT)
+ immediateChildQueueName := childQueuePath
+ if childIndex != -1 {
+ immediateChildQueueName = childQueuePath[:childIndex]
+ }
Review Comment:
Good suggestion, addressed in latest PR.
##########
pkg/scheduler/ugm/queue_tracker_test.go:
##########
@@ -155,3 +155,52 @@ func getQTResource(qt *QueueTracker)
map[string]*resources.Resource {
usage := qt.getResourceUsageDAOInfo("")
return internalGetResource(usage, resources)
}
+
+func TestQTCleanDeletedQueueTracker(t *testing.T) {
Review Comment:
Good suggestion, addressed in latest PR.
--
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]