You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/06/24 02:19:39 UTC

[doris] 03/04: [fix](proc) Fix bug that TrashProcDir cannot show backend trash detail normally (#10365)

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

morningman pushed a commit to branch dev-1.0.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit b35fac5650bf99e5485a5f54b1b3ad7d9bf31dc8
Author: caiconghui <55...@users.noreply.github.com>
AuthorDate: Fri Jun 24 08:56:32 2022 +0800

    [fix](proc) Fix bug that TrashProcDir cannot show backend trash detail normally (#10365)
---
 .../org/apache/doris/common/proc/TrashProcDir.java   | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/proc/TrashProcDir.java b/fe/fe-core/src/main/java/org/apache/doris/common/proc/TrashProcDir.java
index e1b0b859b3..493ce936cc 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/proc/TrashProcDir.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/proc/TrashProcDir.java
@@ -26,7 +26,6 @@ import org.apache.doris.common.Pair;
 import org.apache.doris.common.ClientPool;
 import org.apache.doris.common.util.DebugUtil;
 
-import com.google.common.base.Strings;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
@@ -74,7 +73,6 @@ public class TrashProcDir implements ProcDirInterface {
     }
 
     public static void getTrashInfo(List<Backend> backends, List<List<String>> infos) {
-
         for (Backend backend : backends) {
             BackendService.Client client = null;
             TNetworkAddress address = null;
@@ -116,23 +114,17 @@ public class TrashProcDir implements ProcDirInterface {
     }
 
     @Override
-    public ProcNodeInterface lookup(String backendHostAndPort) throws AnalysisException {
-        if (Strings.isNullOrEmpty(backendHostAndPort)) {
-            throw new AnalysisException("BackendHost:HeartBeatPort is null");
-        }
-        String backendHost;
-        int backendHeartBeatPort;
+    public ProcNodeInterface lookup(String backendIdStr) throws AnalysisException {
+        long backendId = -1;
         try {
-            backendHost = backendHostAndPort.split(":")[0];
-            backendHeartBeatPort = Integer.parseInt(backendHostAndPort.split(":")[1]);
+            backendId = Long.parseLong(backendIdStr);
         } catch (NumberFormatException e) {
-            throw new AnalysisException("Invalid backend format: " + backendHostAndPort);
+            throw new AnalysisException("Invalid backend id format: " + backendIdStr);
         }
-        Backend backend = Catalog.getCurrentSystemInfo().getBackendWithHeartbeatPort(backendHost, backendHeartBeatPort);
+        Backend backend = Catalog.getCurrentSystemInfo().getBackend(backendId);
         if (backend == null) {
-            throw new AnalysisException("Backend[" + backendHostAndPort + "] does not exist.");
+            throw new AnalysisException("Backend[" + backendId + "] does not exist.");
         }
-
         return new TrashProcNode(backend);
     }
 }


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