manirajv06 commented on a change in pull request #223:
URL: 
https://github.com/apache/incubator-yunikorn-core/pull/223#discussion_r563832692



##########
File path: pkg/webservice/routes.go
##########
@@ -127,6 +127,13 @@ var webRoutes = routes{
                getContainerHistory,
        },
 
+       route{
+               "Scheduler",
+               "GET",
+               "/ws/v1/partition/{partition}/queues",
+               getPartitionQueues,

Review comment:
       Idea is to migrate the users to newly designed API's and slowly retire 
old one's. Hence, didn't touched the old places, in fact created a completely 
new dao's, struct etc and planning to take care of all clean up activities 
after the adoption through separate jira's. This way, we need not worry to 
about backward compatibility etc. Hope it makes sense.

##########
File path: pkg/webservice/handlers.go
##########
@@ -521,3 +523,24 @@ func updateConfiguration(conf string) (string, error) {
        }
        return "", fmt.Errorf("config plugin not found")
 }
+
+func getPartitionQueues(w http.ResponseWriter, r *http.Request) {
+       vars := mux.Vars(r)
+       writeHeaders(w)
+       _, partitionExists := vars["partition"]
+       if len(vars) == 0 || !partitionExists {
+               http.Error(w, "Mandatory parameters are missing in URL path. 
Please check the usage documentation", http.StatusBadRequest)

Review comment:
       Taken care.

##########
File path: pkg/webservice/handlers.go
##########
@@ -521,3 +523,24 @@ func updateConfiguration(conf string) (string, error) {
        }
        return "", fmt.Errorf("config plugin not found")
 }
+
+func getPartitionQueues(w http.ResponseWriter, r *http.Request) {
+       vars := mux.Vars(r)
+       writeHeaders(w)
+       _, partitionExists := vars["partition"]

Review comment:
       Taken care.

##########
File path: pkg/webservice/dao/queue_info.go
##########
@@ -31,3 +31,16 @@ type QueueCapacity struct {
        UsedCapacity    string `json:"usedcapacity"`
        AbsUsedCapacity string `json:"absusedcapacity"`
 }
+
+type PartitionQueueDAOInfo struct {
+       QueueName          string                  `json:"queuename"`
+       Status             string                  `json:"status"`
+       Partition          string                  `json:"partition"`
+       MaxResource        string                  `json:"maxResource"`
+       GuaranteedResource string                  `json:"guaranteedResource"`
+       AllocatedResource  string                  `json:"allocatedResource"`
+       IsLeaf             bool                    `json:"isLeaf"`
+       IsManaged          bool                    `json:"isManaged"`
+       Parent             string                  `json:"parent"`
+       Children           []PartitionQueueDAOInfo `json:"children"`
+}

Review comment:
       Comment 
https://github.com/apache/incubator-yunikorn-core/pull/223#discussion_r563832692
 covers this too.

##########
File path: pkg/webservice/handlers.go
##########
@@ -521,3 +523,24 @@ func updateConfiguration(conf string) (string, error) {
        }
        return "", fmt.Errorf("config plugin not found")
 }
+
+func getPartitionQueues(w http.ResponseWriter, r *http.Request) {
+       vars := mux.Vars(r)
+       writeHeaders(w)
+       _, partitionExists := vars["partition"]
+       if len(vars) == 0 || !partitionExists {
+               http.Error(w, "Mandatory parameters are missing in URL path. 
Please check the usage documentation", http.StatusBadRequest)
+               return
+       }
+       var partitionQueuesDAOInfo dao.PartitionQueueDAOInfo
+       var partition = schedulerContext.GetPartition(vars["partition"])
+       if partition != nil {
+               partitionQueuesDAOInfo = partition.GetPartitionQueues()
+       } else {
+               http.Error(w, "partition not found", 
http.StatusInternalServerError)

Review comment:
       Taken care.




----------------------------------------------------------------
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:
[email protected]


Reply via email to