Skip to content

Commit 9765ec8

Browse files
authored
Pipe: Show "CONFIG_REGION" string instead of MIN_VALUE in PipeTableResp (apache#16372)
1 parent 7377aaa commit 9765ec8

File tree

1 file changed

+13
-1
lines changed
  • iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/response/pipe/task

1 file changed

+13
-1
lines changed

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/response/pipe/task/PipeTableResp.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public class PipeTableResp implements DataSet {
5353
private final TSStatus status;
5454
private final List<PipeMeta> allPipeMeta;
5555

56+
private static final String CONFIG_REGION_ID = "CONFIG_REGION";
57+
5658
public PipeTableResp(final TSStatus status, final List<PipeMeta> allPipeMeta) {
5759
this.status = status;
5860
this.allPipeMeta = allPipeMeta;
@@ -164,7 +166,17 @@ public TShowPipeResp convertToTShowPipeResp() {
164166
final Set<Integer> regionIds = entry.getValue();
165167
exceptionMessageBuilder
166168
.append("regionIds: ")
167-
.append(regionIds)
169+
.append(
170+
regionIds.stream()
171+
.map(
172+
id -> {
173+
if (Objects.equals(Integer.MIN_VALUE, id)) {
174+
// handle config region id for user experience
175+
return CONFIG_REGION_ID;
176+
}
177+
return id.toString();
178+
})
179+
.collect(Collectors.toSet()))
168180
.append(", ")
169181
.append(exceptionMessage);
170182
if (++count < size) {

0 commit comments

Comments
 (0)