You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ji...@apache.org on 2021/11/04 02:19:42 UTC

[incubator-doris] branch revert-6999-fe-addbackends created (now b789970)

This is an automated email from the ASF dual-hosted git repository.

jiafengzheng pushed a change to branch revert-6999-fe-addbackends
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git.


      at b789970  Revert "[HTTP][API] Add Backend By Rest API (#6999)"

This branch includes the following new commits:

     new b789970  Revert "[HTTP][API] Add Backend By Rest API (#6999)"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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


[incubator-doris] 01/01: Revert "[HTTP][API] Add Backend By Rest API (#6999)"

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jiafengzheng pushed a commit to branch revert-6999-fe-addbackends
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git

commit b7899701e5f33557505043bf4e3fab3e628a95c8
Author: jiafeng.zhang <zh...@gmail.com>
AuthorDate: Thu Nov 4 10:19:34 2021 +0800

    Revert "[HTTP][API] Add Backend By Rest API (#6999)"
    
    This reverts commit f509e936573f8d6fdaf4de036bc3c6abef26a182.
---
 .../doris/httpv2/rest/manager/ClusterAction.java   | 41 ++++------------------
 1 file changed, 6 insertions(+), 35 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/manager/ClusterAction.java b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/manager/ClusterAction.java
index ac46aae..9b4af46 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/manager/ClusterAction.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/manager/ClusterAction.java
@@ -17,30 +17,27 @@
 
 package org.apache.doris.httpv2.rest.manager;
 
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
 import org.apache.doris.catalog.Catalog;
 import org.apache.doris.common.Config;
-import org.apache.doris.common.Pair;
-import org.apache.doris.common.UserException;
 import org.apache.doris.httpv2.entity.ResponseEntityBuilder;
 import org.apache.doris.httpv2.rest.RestBaseController;
 import org.apache.doris.mysql.privilege.PrivPredicate;
 import org.apache.doris.qe.ConnectContext;
 import org.apache.doris.system.Frontend;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.springframework.web.bind.annotation.RequestBody;
+
+import com.google.common.collect.Maps;
+
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 /*
  * Used to return the cluster information for the manager.
  */
@@ -48,8 +45,6 @@ import java.util.stream.Collectors;
 @RequestMapping("/rest/v2/manager/cluster")
 public class ClusterAction extends RestBaseController {
 
-    private static final Logger LOG = LogManager.getLogger(ClusterAction.class);
-
     // Returns mysql and http connection information for the cluster.
     // {
     //		"mysql":[
@@ -74,28 +69,4 @@ public class ClusterAction extends RestBaseController {
         result.put("http", frontends.stream().map(ip -> ip + ":" + Config.http_port).collect(Collectors.toList()));
         return ResponseEntityBuilder.ok(result);
     }
-
-    /**
-     * add backend like execute alter system add backend "host:port"
-     */
-    @RequestMapping(path = "/add_backends", method = RequestMethod.POST)
-    public Object addBackends(HttpServletRequest request, HttpServletResponse response,
-                              @RequestBody Map<String, Integer> hostPorts) {
-        executeCheckPassword(request, response);
-        checkGlobalAuth(ConnectContext.get().getCurrentUserIdentity(), PrivPredicate.ADMIN);
-
-        Map<String, Boolean> result = Maps.newHashMap();
-        for (Map.Entry<String, Integer> backend : hostPorts.entrySet()) {
-            List<Pair<String, Integer>> newBackend = Lists.newArrayList();
-            newBackend.add(Pair.create(backend.getKey(), backend.getValue()));
-            try {
-                Catalog.getCurrentSystemInfo().addBackends(newBackend, false);
-                result.put(backend.getKey(), true);
-            } catch (UserException e) {
-                LOG.error("Failed to add backend node: {}:{}", backend.getKey(), backend.getValue(), e);
-                result.put(backend.getKey(), false);
-            }
-        }
-        return ResponseEntityBuilder.ok(result);
-    }
 }

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