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 2021/06/07 23:10:57 UTC

[GitHub] [incubator-yunikorn-core] yangwwei commented on a change in pull request #274: YUNIKORN-678: Refactoring REST API re-design changes in handlers.go, handlers_test.go

yangwwei commented on a change in pull request #274:
URL: https://github.com/apache/incubator-yunikorn-core/pull/274#discussion_r646998495



##########
File path: pkg/webservice/handlers.go
##########
@@ -690,16 +690,14 @@ func getQueueApplications(w http.ResponseWriter, r *http.Request) {
 	var appExistsInPartition = false
 	var appExistsInQueue = false
 	var appsDao []*dao.ApplicationDAOInfo
-	lists := schedulerContext.GetPartitionMapClone()
-	for _, partitionContext := range lists {
-		if partitionContext.Name == partition {
-			appExistsInPartition = true
-			appList := partitionContext.GetApplications()
-			for _, app := range appList {
-				if strings.EqualFold(queueName, app.GetQueueName()) {
-					appExistsInQueue = true
-					appsDao = append(appsDao, getApplicationJSON(app))
-				}
+	partitionContext := schedulerContext.GetPartitionWithoutClusterID(partition)
+	if partitionContext != nil {
+		appExistsInPartition = true
+		appList := partitionContext.GetApplications()
+		for _, app := range appList {
+			if strings.EqualFold(queueName, app.GetQueueName()) {
+				appExistsInQueue = true

Review comment:
       Minor: do we still need this var: `appExistsInQueue`?




-- 
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.

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