morningman commented on code in PR #14904:
URL: https://github.com/apache/doris/pull/14904#discussion_r1043318133


##########
fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/manager/NodeAction.java:
##########
@@ -600,9 +596,89 @@ public Object setConfigBe(HttpServletRequest request, 
HttpServletResponse respon
         return ResponseEntityBuilder.ok(data);
     }
 
+    @PostMapping("/{action}/be")
+    public ResponseEntity operateBackend(@PathVariable String action, 
@RequestBody BackendReqInfo reqInfo) {
+        try {
+            List<String> hostPorts = reqInfo.getHostPorts();
+            List<HostInfo> hostInfos = new ArrayList<>();
+            for (String hostPort : hostPorts) {
+                hostInfos.add(SystemInfoService.getIpHostAndPort(hostPort, 
true));
+            }
+            SystemInfoService currentSystemInfo = Env.getCurrentSystemInfo();
+            if ("ADD".equals(action)) {
+                Map<String, String> properties;
+                if (reqInfo.getProperties() == null) {
+                    properties = new HashMap<>();
+                } else {
+                    properties = reqInfo.getProperties();
+                }
+                Map<String, String> tagMap = 
PropertyAnalyzer.analyzeBackendTagsProperties(properties,
+                        Tag.DEFAULT_BACKEND_TAG);
+                currentSystemInfo.addBackends(hostInfos, false, "", tagMap);

Review Comment:
   Need to forward to master FE



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