kingamarton commented on a change in pull request #226:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/226#discussion_r631867799
##########
File path: pkg/webservice/handlers.go
##########
@@ -610,3 +612,30 @@ func getPartitions(w http.ResponseWriter, r *http.Request)
{
buildJSONErrorResponse(w, err.Error(),
http.StatusInternalServerError)
}
}
+
+func getPartitionNodes(w http.ResponseWriter, r *http.Request) {
+ vars := mux.Vars(r)
+ writeHeaders(w)
+ partition, partitionExists := vars["partition"]
+ if !partitionExists {
+ buildJSONErrorResponse(w, "Partition is missing in URL path.
Please check the usage documentation", http.StatusBadRequest)
+ return
+ }
+ if len(vars) != 1 {
+ buildJSONErrorResponse(w, "Incorrect URL path. Please check the
usage documentation", http.StatusBadRequest)
+ return
+ }
+ partitionContext := schedulerContext.GetPartition(partition)
Review comment:
This part is is the same for all the PR's. Can you please extract it in
a method and reuse it?
--
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]