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 00:56:38 UTC

[doris] branch master updated: [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 master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new e3d549cdfa [fix](proc) Fix bug that TrashProcDir cannot show backend trash detail normally (#10365)
e3d549cdfa is described below

commit e3d549cdfacd69ee0d8c1642e55de705c96ffee4
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 f371c37b92..148150281d 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.system.Backend;
 import org.apache.doris.thrift.BackendService;
 import org.apache.doris.thrift.TNetworkAddress;
 
-import com.google.common.base.Strings;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
@@ -73,7 +72,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;
@@ -114,23 +112,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