jerqi commented on code in PR #938:
URL: https://github.com/apache/incubator-uniffle/pull/938#discussion_r1229468074


##########
coordinator/src/main/java/org/apache/uniffle/coordinator/web/servlet/NodesServlet.java:
##########
@@ -37,20 +37,36 @@ public NodesServlet(CoordinatorServer coordinator) {
   }
 
   @Override
-  protected Response<List<ServerNode>> handleGet(HttpServletRequest req, 
HttpServletResponse resp) {
-    List<ServerNode> serverList = 
coordinator.getClusterManager().getServerList(Collections.EMPTY_SET);
-    String id = req.getParameter("id");
-    String status = req.getParameter("status");
-    serverList = serverList.stream().filter((server) -> {
-      if (id != null && !id.equals(server.getId())) {
-        return false;
+  protected Response handleGet(HttpServletRequest req, HttpServletResponse 
resp) {
+    String requestURI = req.getRequestURI();
+    String methodName = requestURI.substring(requestURI.lastIndexOf("/"));
+    if (methodName == null || methodName.length() == 0) {
+      return Response.success("The requested address is incorrect, please 
confirm!");
+    } else {
+      if (methodName.equalsIgnoreCase("getUnhealthy")) {

Review Comment:
   > Currently, the url is like /api/server/nodes?status=ACTIVE, but in this 
pr, it will be like /api/server/nodes/getActive?status=ACTIVE, i think it is 
weird. In the future, i want to change it to be like /api/server/nodes/ACTIVE.
   
   Agree with you.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to