You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/08 12:50:36 UTC

[GitHub] [doris] morningman commented on a diff in pull request #14904: [Feature](Api) Support operate node(fe/be).

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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org