Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,14 @@ Duplicate status view mainly looks at the status of the duplicate, as well as th
`SHOW TABLET FROM tbl1;`

```
+----------+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------- -+--------------+----------------------+
| TabletId | ReplicaId | BackendId | Version | VersionHash | LstSuccessVersion | LstSuccessVersionHash | LstFailedVersion | LstFailedVersionHash | LstFailedTime | DataSize | RowCount | State | LstConsistencyCheckTime | CheckVersion | CheckVersionHash | VersionCount | PathHash |
+----------+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------- -+--------------+----------------------+
| 29502429 | 29502432 | 10006 | 2 | 0 | 2 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -5822326203532286804 |
| 29502429 | 36885996 | 10002 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -1441285706148429853 |
| 29502429 | 48100551 | 10007 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -4784691547051455525 |
+----------+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------- -+--------------+----------------------+
```
+----------+-----------+-----------+------------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------------+--------------+----------------------+----------------------+----------------------+
| TabletId | ReplicaId | BackendId | SchemaHash | Version | VersionHash | LstSuccessVersion | LstSuccessVersionHash | LstFailedVersion | LstFailedVersionHash | LstFailedTime | DataSize | RowCount | State | LstConsistencyCheckTime | CheckVersion | CheckVersionHash | VersionCount | PathHash | MetaUrl | CompactionStatus |
+----------+-----------+-----------+------------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------------+--------------+----------------------+----------------------+----------------------+
| 29502429 | 29502432 | 10006 | 1421156361 | 2 | 0 | 2 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -5822326203532286804 | url | url |
| 29502429 | 36885996 | 10002 | 1421156361 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -1441285706148429853 | url | url |
| 29502429 | 48100551 | 10007 | 1421156361 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -4784691547051455525 | url | url |
+----------+-----------+-----------+------------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------------+--------------+----------------------+----------------------+----------------------+
```

The figure above shows some additional information, including copy size, number of rows, number of versions, where the data path is located.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,13 @@ TabletScheduler 在每轮调度时,都会通过 LoadBalancer 来选择一定
`SHOW TABLET FROM tbl1;`

```
+----------+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------- -+--------------+----------------------+
| TabletId | ReplicaId | BackendId | Version | VersionHash | LstSuccessVersion | LstSuccessVersionHash | LstFailedVersion | LstFailedVersionHash | LstFailedTime | DataSize | RowCount | State | LstConsistencyCheckTime | CheckVersion | CheckVersionHash | VersionCount | PathHash |
+----------+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------- -+--------------+----------------------+
| 29502429 | 29502432 | 10006 | 2 | 0 | 2 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -5822326203532286804 |
| 29502429 | 36885996 | 10002 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -1441285706148429853 |
| 29502429 | 48100551 | 10007 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -4784691547051455525 |
+----------+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------- -+--------------+----------------------+
+----------+-----------+-----------+------------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------------+--------------+----------------------+----------------------+----------------------+
| TabletId | ReplicaId | BackendId | SchemaHash | Version | VersionHash | LstSuccessVersion | LstSuccessVersionHash | LstFailedVersion | LstFailedVersionHash | LstFailedTime | DataSize | RowCount | State | LstConsistencyCheckTime | CheckVersion | CheckVersionHash | VersionCount | PathHash | MetaUrl | CompactionStatus |
+----------+-----------+-----------+------------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------------+--------------+----------------------+----------------------+----------------------+
| 29502429 | 29502432 | 10006 | 1421156361 | 2 | 0 | 2 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -5822326203532286804 | url | url |
| 29502429 | 36885996 | 10002 | 1421156361 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -1441285706148429853 | url | url |
| 29502429 | 48100551 | 10007 | 1421156361 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | 784 | 0 | NORMAL | N/A | -1 | -1 | 2 | -4784691547051455525 | url | url |
+----------+-----------+-----------+------------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+----------+----------+--------+-------------------------+--------------+----------------------+--------------+----------------------+----------------------+----------------------+
```

上图展示了包括副本大小、行数、版本数量、所在数据路径等一些额外的信息。
Expand Down
21 changes: 19 additions & 2 deletions fe/src/main/java/org/apache/doris/common/proc/TabletsProcDir.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
import org.apache.doris.common.AnalysisException;
import org.apache.doris.common.util.ListComparator;
import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.system.Backend;

import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

import java.util.ArrayList;
import java.util.Collections;
Expand All @@ -45,7 +47,7 @@ public class TabletsProcDir implements ProcDirInterface {
.add("LstFailedVersion").add("LstFailedVersionHash").add("LstFailedTime")
.add("DataSize").add("RowCount").add("State")
.add("LstConsistencyCheckTime").add("CheckVersion").add("CheckVersionHash")
.add("VersionCount").add("PathHash")
.add("VersionCount").add("PathHash").add("MetaUrl").add("CompactionStatus")
.build();

private Database db;
Expand All @@ -59,6 +61,7 @@ public TabletsProcDir(Database db, MaterializedIndex index) {
public List<List<Comparable>> fetchComparableResult(long version, long backendId, Replica.ReplicaState state) {
Preconditions.checkNotNull(db);
Preconditions.checkNotNull(index);
ImmutableMap<Long, Backend> backendMap = Catalog.getCurrentSystemInfo().getIdToBackend();

List<List<Comparable>> tabletInfos = new ArrayList<List<Comparable>>();
db.readLock();
Expand Down Expand Up @@ -88,6 +91,8 @@ public List<List<Comparable>> fetchComparableResult(long version, long backendId
tabletInfo.add(-1); // check version hash
tabletInfo.add(-1); // version count
tabletInfo.add(-1); // path hash
tabletInfo.add("N/A"); // meta url
tabletInfo.add("N/A"); // compaction status

tabletInfos.add(tabletInfo);
} else {
Expand Down Expand Up @@ -119,7 +124,19 @@ public List<List<Comparable>> fetchComparableResult(long version, long backendId
tabletInfo.add(tablet.getCheckedVersionHash());
tabletInfo.add(replica.getVersionCount());
tabletInfo.add(replica.getPathHash());

String metaUrl = String.format("http://%s:%d/api/meta/header/%d/%d",
backendMap.get(replica.getBackendId()).getHost(),
backendMap.get(replica.getBackendId()).getHttpPort(),
tabletId,
replica.getSchemaHash());
tabletInfo.add(metaUrl);
String compactionUrl = String.format(
"http://%s:%d/api/compaction/show?tablet_id=%d&schema_hash=%d",
backendMap.get(replica.getBackendId()).getHost(),
backendMap.get(replica.getBackendId()).getHttpPort(),
tabletId,
replica.getSchemaHash());
tabletInfo.add(compactionUrl);
tabletInfos.add(tabletInfo);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.doris.http.action;

import org.apache.commons.validator.routines.UrlValidator;
import org.apache.doris.analysis.RedirectStatus;
import org.apache.doris.catalog.Catalog;
import org.apache.doris.common.AnalysisException;
Expand Down Expand Up @@ -132,6 +133,7 @@ private void appendSystemInfo(StringBuilder buffer, String procPath, String path
}

private void appendSystemTableBody(StringBuilder buffer, List<List<String>> rows, boolean isDir, String path) {
UrlValidator validator = new UrlValidator();
for ( List<String> strList : rows) {
buffer.append("<tr>");
int columnIndex = 1;
Expand All @@ -142,6 +144,10 @@ private void appendSystemTableBody(StringBuilder buffer, List<List<String>> rows
buffer.append("<a href=\"?path=" + path + "/" + escapeStr + "\">");
buffer.append(str);
buffer.append("</a>");
} else if (validator.isValid(str)) {
buffer.append("<a href=\"" + str + "\">");
buffer.append("URL");
buffer.append("</a>");
} else {
buffer.append(str.replaceAll("\\n", "<br/>"));
}
Expand Down