This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 5c8ea147b1 [Bugfix](FE) fix npe issue when exec 'show tablets' #11896
5c8ea147b1 is described below
commit 5c8ea147b138192620c370518d7dc527d73bacfb
Author: GoGoWen <[email protected]>
AuthorDate: Fri Aug 19 21:31:58 2022 +0800
[Bugfix](FE) fix npe issue when exec 'show tablets' #11896
---
.../java/org/apache/doris/common/proc/TabletsProcDir.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/proc/TabletsProcDir.java
b/fe/fe-core/src/main/java/org/apache/doris/common/proc/TabletsProcDir.java
index 71a355c59c..79fc9fd4b1 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/proc/TabletsProcDir.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/proc/TabletsProcDir.java
@@ -120,16 +120,20 @@ public class TabletsProcDir implements ProcDirInterface {
tabletInfo.add(tablet.getCheckedVersion());
tabletInfo.add(replica.getVersionCount());
tabletInfo.add(replica.getPathHash());
+
+ Backend be = backendMap.get(replica.getBackendId());
+ String host = (be == null ? Backend.DUMMY_IP :
be.getHost());
+ int port = (be == null ? 0 : be.getHttpPort());
String metaUrl =
String.format("http://%s:%d/api/meta/header/%d",
-
backendMap.get(replica.getBackendId()).getHost(),
-
backendMap.get(replica.getBackendId()).getHttpPort(),
+ host,
+ port,
tabletId,
replica.getSchemaHash());
tabletInfo.add(metaUrl);
String compactionUrl = String.format(
"http://%s:%d/api/compaction/show?tablet_id=%d",
-
backendMap.get(replica.getBackendId()).getHost(),
-
backendMap.get(replica.getBackendId()).getHttpPort(),
+ host,
+ port,
tabletId,
replica.getSchemaHash());
tabletInfo.add(compactionUrl);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]