This is an automated email from the ASF dual-hosted git repository.
jianglongtao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 1a10a13 [DistSQL] Adjust the display of the `show instance list`
statement (#13787)
1a10a13 is described below
commit 1a10a1356b2a44e526d18494afabff0b663afe29
Author: lanchengx <[email protected]>
AuthorDate: Thu Nov 25 07:52:11 2021 -0600
[DistSQL] Adjust the display of the `show instance list` statement (#13787)
* Adjust display.
* Adjust display.
---
.../ral/common/show/executor/ShowInstanceExecutor.java | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/show/executor/ShowInstanceExecutor.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/show/executor/ShowInstanceExecutor.java
index 3d1393d..352d6dd 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/show/executor/ShowInstanceExecutor.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/show/executor/ShowInstanceExecutor.java
@@ -34,6 +34,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
+import java.util.stream.Stream;
/**
* Show instance executor.
@@ -42,9 +43,7 @@ public final class ShowInstanceExecutor extends
AbstractShowExecutor {
private static final String DELIMITER = "@";
- private static final String IP = "ip";
-
- private static final String PORT = "port";
+ private static final String ID = "instance_id";
private static final String STATUS = "status";
@@ -55,8 +54,7 @@ public final class ShowInstanceExecutor extends
AbstractShowExecutor {
@Override
protected List<QueryHeader> createQueryHeaders() {
return Arrays.asList(
- new QueryHeader("", "", IP, IP, Types.VARCHAR, "VARCHAR", 64,
0, false, false, false, false),
- new QueryHeader("", "", PORT, PORT, Types.VARCHAR, "VARCHAR",
64, 0, false, false, false, false),
+ new QueryHeader("", "", ID, ID, Types.VARCHAR, "VARCHAR", 64,
0, false, false, false, false),
new QueryHeader("", "", STATUS, STATUS, Types.VARCHAR,
"VARCHAR", 64, 0, false, false, false, false)
);
}
@@ -93,8 +91,6 @@ public final class ShowInstanceExecutor extends
AbstractShowExecutor {
}
private List<Object> buildRow(final String instanceId, final String
status) {
- LinkedList<Object> result =
Arrays.stream(instanceId.split(DELIMITER)).map(each -> (Object)
each).collect(Collectors.toCollection(LinkedList::new));
- result.add(status);
- return result;
+ return Stream.of(instanceId, status).map(each -> (Object)
each).collect(Collectors.toCollection(LinkedList::new));
}
}