This is an automated email from the ASF dual-hosted git repository.
shuwenwei pushed a commit to branch separationOfAdminPowers
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/separationOfAdminPowers by
this push:
new 2e901dddf60 add showAvailableUrls
2e901dddf60 is described below
commit 2e901dddf607b954f5fbe05476cd88a6dc6739e9
Author: shuwenwei <[email protected]>
AuthorDate: Fri Sep 12 14:28:37 2025 +0800
add showAvailableUrls
---
.../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 | 7 +-
.../antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4 | 8 +++
.../common/header/DatasetHeaderFactory.java | 4 ++
.../iotdb/db/queryengine/plan/Coordinator.java | 2 +
.../execution/config/TableConfigTaskVisitor.java | 9 +++
.../execution/config/TreeConfigTaskVisitor.java | 8 +++
.../config/executor/ClusterConfigTaskExecutor.java | 21 ++++++
.../config/executor/IConfigTaskExecutor.java | 2 +
.../config/metadata/ShowAvailableUrlsTask.java | 75 ++++++++++++++++++++++
.../db/queryengine/plan/parser/ASTVisitor.java | 6 ++
.../plan/relational/sql/ast/AstVisitor.java | 4 ++
.../plan/relational/sql/ast/ShowAvailableUrls.java | 61 ++++++++++++++++++
.../plan/relational/sql/parser/AstBuilder.java | 7 ++
.../queryengine/plan/statement/StatementType.java | 3 +-
.../plan/statement/StatementVisitor.java | 6 ++
.../metadata/ShowAvailableUrlsStatement.java | 55 ++++++++++++++++
.../schema/column/ColumnHeaderConstant.java | 7 ++
.../db/relational/grammar/sql/RelationalSql.g4 | 7 ++
18 files changed, 290 insertions(+), 2 deletions(-)
diff --git
a/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
b/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
index 475a40dd0ca..c92989c2fa9 100644
---
a/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
+++
b/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
@@ -61,7 +61,7 @@ ddlStatement
// CQ
| createContinuousQuery | dropContinuousQuery | showContinuousQueries
// Cluster
- | showVariables | showCluster | showRegions | showDataNodes |
showConfigNodes | showClusterId
+ | showVariables | showCluster | showRegions | showDataNodes |
showAvailableUrls | showConfigNodes | showClusterId
| getRegionId | getTimeSlotList | countTimeSlotList | getSeriesSlotList
| migrateRegion | reconstructRegion | extendRegion | removeRegion |
removeDataNode | removeConfigNode | removeAINode
| verifyConnection
@@ -486,6 +486,11 @@ showDataNodes
: SHOW DATANODES
;
+// ---- Show Available Urls
+showAvailableUrls
+ : SHOW AVAILABLE URLS
+ ;
+
// ---- Show Config Nodes
showConfigNodes
: SHOW CONFIGNODES
diff --git
a/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
b/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
index 0054bf779fd..6a6d1e11e54 100644
--- a/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
+++ b/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
@@ -246,6 +246,14 @@ DATANODES
: D A T A N O D E S
;
+AVAILABLE
+ : A V A I L A B L E
+ ;
+
+URLS
+ : U R L S
+ ;
+
DATASET
: D A T A S E T
;
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/header/DatasetHeaderFactory.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/header/DatasetHeaderFactory.java
index c69dee793b9..4bc8a37277d 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/header/DatasetHeaderFactory.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/header/DatasetHeaderFactory.java
@@ -129,6 +129,10 @@ public class DatasetHeaderFactory {
return new DatasetHeader(ColumnHeaderConstant.showDataNodesColumnHeaders,
true);
}
+ public static DatasetHeader getShowAvailableUrlsHeader() {
+ return new
DatasetHeader(ColumnHeaderConstant.showAvailableUrlsColumnHeaders, true);
+ }
+
public static DatasetHeader getShowConfigNodesHeader() {
return new
DatasetHeader(ColumnHeaderConstant.showConfigNodesColumnHeaders, true);
}
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
index e9f952f2eed..a7cf84233c1 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
@@ -94,6 +94,7 @@ import
org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SetSqlDialect;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SetSystemStatus;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SetTableComment;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowAINodes;
+import
org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowAvailableUrls;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowCluster;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowClusterId;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowConfigNodes;
@@ -432,6 +433,7 @@ public class Coordinator {
|| statement instanceof ShowCluster
|| statement instanceof ShowRegions
|| statement instanceof ShowDataNodes
+ || statement instanceof ShowAvailableUrls
|| statement instanceof ShowConfigNodes
|| statement instanceof ShowAINodes
|| statement instanceof Flush
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
index 6974d327aa3..1e316bff16d 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
@@ -49,6 +49,7 @@ import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.DropPipePl
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.RemoveAINodeTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.RemoveConfigNodeTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.RemoveDataNodeTask;
+import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowAvailableUrlsTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowClusterIdTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowClusterTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowFunctionsTask;
@@ -175,6 +176,7 @@ import
org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SetSqlDialect;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SetSystemStatus;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SetTableComment;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowAINodes;
+import
org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowAvailableUrls;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowCluster;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowClusterId;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowConfigNodes;
@@ -461,6 +463,13 @@ public class TableConfigTaskVisitor extends
AstVisitor<IConfigTask, MPPQueryCont
return new ShowDataNodesTask();
}
+ @Override
+ protected IConfigTask visitShowAvailableUrls(
+ final ShowAvailableUrls showAvailableUrls, final MPPQueryContext
context) {
+ context.setQueryType(QueryType.READ);
+ return new ShowAvailableUrlsTask();
+ }
+
@Override
protected IConfigTask visitShowConfigNodes(
final ShowConfigNodes showConfigNodesStatement, final MPPQueryContext
context) {
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TreeConfigTaskVisitor.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TreeConfigTaskVisitor.java
index b2ea4a2330f..e74053f875a 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TreeConfigTaskVisitor.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TreeConfigTaskVisitor.java
@@ -48,6 +48,7 @@ import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.RemoveConf
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.RemoveDataNodeTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.SetTTLTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowAINodesTask;
+import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowAvailableUrlsTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowClusterDetailsTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowClusterIdTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowClusterTask;
@@ -134,6 +135,7 @@ import
org.apache.iotdb.db.queryengine.plan.statement.metadata.RemoveAINodeState
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.RemoveConfigNodeStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.RemoveDataNodeStatement;
import org.apache.iotdb.db.queryengine.plan.statement.metadata.SetTTLStatement;
+import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowAvailableUrlsStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowClusterIdStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowClusterStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowConfigNodesStatement;
@@ -521,6 +523,12 @@ public class TreeConfigTaskVisitor extends
StatementVisitor<IConfigTask, MPPQuer
return new ShowDataNodesTask(showDataNodesStatement);
}
+ @Override
+ public IConfigTask visitShowAvailableUrls(
+ ShowAvailableUrlsStatement showAvailableUrlsStatement, MPPQueryContext
context) {
+ return new ShowAvailableUrlsTask();
+ }
+
@Override
public IConfigTask visitShowConfigNodes(
ShowConfigNodesStatement showConfigNodesStatement, MPPQueryContext
context) {
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
index 4b3771c0215..e3970b7176e 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
@@ -189,6 +189,7 @@ import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.GetRegionI
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.GetSeriesSlotListTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.GetTimeSlotListTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowAINodesTask;
+import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowAvailableUrlsTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowClusterDetailsTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowClusterIdTask;
import
org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowClusterTask;
@@ -1689,6 +1690,26 @@ public class ClusterConfigTaskExecutor implements
IConfigTaskExecutor {
return future;
}
+ @Override
+ public SettableFuture<ConfigTaskResult> showAvailableUrls() {
+ final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
+ TShowDataNodesResp showDataNodesResp = new TShowDataNodesResp();
+ try (final ConfigNodeClient client =
+
CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
+ showDataNodesResp = client.showDataNodes();
+ if (showDataNodesResp.getStatus().getCode() !=
TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+ future.setException(
+ new IoTDBException(
+ showDataNodesResp.getStatus().message,
showDataNodesResp.getStatus().code));
+ return future;
+ }
+ } catch (final ClientManagerException | TException e) {
+ future.setException(e);
+ }
+ ShowAvailableUrlsTask.buildTsBlock(showDataNodesResp, future);
+ return future;
+ }
+
@Override
public SettableFuture<ConfigTaskResult> showConfigNodes() {
final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/IConfigTaskExecutor.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/IConfigTaskExecutor.java
index 781d704af51..4bb758f92e7 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/IConfigTaskExecutor.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/IConfigTaskExecutor.java
@@ -182,6 +182,8 @@ public interface IConfigTaskExecutor {
SettableFuture<ConfigTaskResult> showDataNodes();
+ SettableFuture<ConfigTaskResult> showAvailableUrls();
+
SettableFuture<ConfigTaskResult> showConfigNodes();
SettableFuture<ConfigTaskResult> showAINodes();
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ShowAvailableUrlsTask.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ShowAvailableUrlsTask.java
new file mode 100644
index 00000000000..9cdcf0d1202
--- /dev/null
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ShowAvailableUrlsTask.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.queryengine.plan.execution.config.metadata;
+
+import org.apache.iotdb.commons.schema.column.ColumnHeader;
+import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
+import org.apache.iotdb.confignode.rpc.thrift.TDataNodeInfo;
+import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodesResp;
+import org.apache.iotdb.db.queryengine.common.header.DatasetHeader;
+import org.apache.iotdb.db.queryengine.common.header.DatasetHeaderFactory;
+import org.apache.iotdb.db.queryengine.plan.execution.config.ConfigTaskResult;
+import org.apache.iotdb.db.queryengine.plan.execution.config.IConfigTask;
+import
org.apache.iotdb.db.queryengine.plan.execution.config.executor.IConfigTaskExecutor;
+import org.apache.iotdb.rpc.TSStatusCode;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.SettableFuture;
+import org.apache.tsfile.enums.TSDataType;
+import org.apache.tsfile.read.common.block.TsBlockBuilder;
+import org.apache.tsfile.utils.BytesUtils;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class ShowAvailableUrlsTask implements IConfigTask {
+
+ @Override
+ public ListenableFuture<ConfigTaskResult> execute(IConfigTaskExecutor
configTaskExecutor)
+ throws InterruptedException {
+ return configTaskExecutor.showAvailableUrls();
+ }
+
+ public static void buildTsBlock(
+ TShowDataNodesResp showDataNodesResp, SettableFuture<ConfigTaskResult>
future) {
+ List<TSDataType> outputDataTypes =
+ ColumnHeaderConstant.showAvailableUrlsColumnHeaders.stream()
+ .map(ColumnHeader::getColumnType)
+ .collect(Collectors.toList());
+ TsBlockBuilder builder = new TsBlockBuilder(outputDataTypes);
+ if (showDataNodesResp.getDataNodesInfoList() != null) {
+ for (TDataNodeInfo dataNodeInfo :
showDataNodesResp.getDataNodesInfoList()) {
+ builder.getTimeColumnBuilder().writeLong(0L);
+ builder.getColumnBuilder(0).writeInt(dataNodeInfo.getDataNodeId());
+ builder
+ .getColumnBuilder(1)
+ .writeBinary(
+ BytesUtils.valueOf(
+ dataNodeInfo.getStatus() == null ? "" :
dataNodeInfo.getStatus()));
+
+
builder.getColumnBuilder(2).writeBinary(BytesUtils.valueOf(dataNodeInfo.getRpcAddresss()));
+ builder.getColumnBuilder(3).writeInt(dataNodeInfo.getRpcPort());
+ builder.declarePosition();
+ }
+ }
+ DatasetHeader datasetHeader =
DatasetHeaderFactory.getShowAvailableUrlsHeader();
+ future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS,
builder.build(), datasetHeader));
+ }
+}
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
index 8b9f65d553f..77fd34d441e 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
@@ -168,6 +168,7 @@ import
org.apache.iotdb.db.queryengine.plan.statement.metadata.RemoveAINodeState
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.RemoveConfigNodeStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.RemoveDataNodeStatement;
import org.apache.iotdb.db.queryengine.plan.statement.metadata.SetTTLStatement;
+import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowAvailableUrlsStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowChildNodesStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowChildPathsStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowClusterIdStatement;
@@ -3631,6 +3632,11 @@ public class ASTVisitor extends
IoTDBSqlParserBaseVisitor<Statement> {
return new ShowDataNodesStatement();
}
+ @Override
+ public Statement
visitShowAvailableUrls(IoTDBSqlParser.ShowAvailableUrlsContext ctx) {
+ return new ShowAvailableUrlsStatement();
+ }
+
// show confignodes
@Override
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java
index f4ceb114632..46f85b39df6 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java
@@ -393,6 +393,10 @@ public abstract class AstVisitor<R, C> {
return visitStatement(node, context);
}
+ protected R visitShowAvailableUrls(ShowAvailableUrls node, C context) {
+ return visitStatement(node, context);
+ }
+
protected R visitShowConfigNodes(ShowConfigNodes node, C context) {
return visitStatement(node, context);
}
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowAvailableUrls.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowAvailableUrls.java
new file mode 100644
index 00000000000..2117cdfdac2
--- /dev/null
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowAvailableUrls.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.queryengine.plan.relational.sql.ast;
+
+import com.google.common.collect.ImmutableList;
+
+import java.util.List;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+public class ShowAvailableUrls extends Statement {
+
+ public ShowAvailableUrls() {
+ super(null);
+ }
+
+ @Override
+ public <R, C> R accept(AstVisitor<R, C> visitor, C context) {
+ return visitor.visitShowAvailableUrls(this, context);
+ }
+
+ @Override
+ public List<Node> getChildren() {
+ return ImmutableList.of();
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ return (obj != null) && (getClass() == obj.getClass());
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper(this).toString();
+ }
+}
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java
index 5d7333e5b46..4cd5ecf9ea7 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java
@@ -174,6 +174,7 @@ import
org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SetSqlDialect;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SetSystemStatus;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SetTableComment;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowAINodes;
+import
org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowAvailableUrls;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowCluster;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowClusterId;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowConfigNodes;
@@ -1377,6 +1378,12 @@ public class AstBuilder extends
RelationalSqlBaseVisitor<Node> {
return new ShowDataNodes();
}
+ @Override
+ public Node visitShowAvailableUrlsStatement(
+ RelationalSqlParser.ShowAvailableUrlsStatementContext ctx) {
+ return new ShowAvailableUrls();
+ }
+
@Override
public Node visitShowConfigNodesStatement(
RelationalSqlParser.ShowConfigNodesStatementContext ctx) {
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementType.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementType.java
index 748241d189b..4bc10b2cd42 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementType.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementType.java
@@ -187,5 +187,6 @@ public enum StatementType {
SET_CONFIGURATION,
- FAST_LAST_QUERY
+ FAST_LAST_QUERY,
+ SHOW_CONFIGURATION,
}
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementVisitor.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementVisitor.java
index 3fb12232a97..a1ebac37313 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementVisitor.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementVisitor.java
@@ -59,6 +59,7 @@ import
org.apache.iotdb.db.queryengine.plan.statement.metadata.RemoveAINodeState
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.RemoveConfigNodeStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.RemoveDataNodeStatement;
import org.apache.iotdb.db.queryengine.plan.statement.metadata.SetTTLStatement;
+import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowAvailableUrlsStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowChildNodesStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowChildPathsStatement;
import
org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowClusterIdStatement;
@@ -475,6 +476,11 @@ public abstract class StatementVisitor<R, C> {
return visitStatement(showDataNodesStatement, context);
}
+ public R visitShowAvailableUrls(
+ ShowAvailableUrlsStatement showAvailableUrlsStatement, C context) {
+ return visitStatement(showAvailableUrlsStatement, context);
+ }
+
public R visitShowConfigNodes(ShowConfigNodesStatement
showConfigNodesStatement, C context) {
return visitStatement(showConfigNodesStatement, context);
}
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/metadata/ShowAvailableUrlsStatement.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/metadata/ShowAvailableUrlsStatement.java
new file mode 100644
index 00000000000..cbdf8cba131
--- /dev/null
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/metadata/ShowAvailableUrlsStatement.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.queryengine.plan.statement.metadata;
+
+import org.apache.iotdb.common.rpc.thrift.TSStatus;
+import org.apache.iotdb.db.queryengine.plan.analyze.QueryType;
+import org.apache.iotdb.db.queryengine.plan.statement.IConfigStatement;
+import org.apache.iotdb.db.queryengine.plan.statement.StatementType;
+import org.apache.iotdb.db.queryengine.plan.statement.StatementVisitor;
+import org.apache.iotdb.rpc.RpcUtils;
+
+public class ShowAvailableUrlsStatement extends ShowStatement implements
IConfigStatement {
+
+ public ShowAvailableUrlsStatement() {
+ super();
+ this.statementType = StatementType.SHOW;
+ }
+
+ @Override
+ public TSStatus checkPermissionBeforeProcess(String userName) {
+ return RpcUtils.SUCCESS_STATUS;
+ }
+
+ @Override
+ public TSStatus checkSeparatedAdminPermissionBeforeProcess(String userName) {
+ return RpcUtils.SUCCESS_STATUS;
+ }
+
+ @Override
+ public QueryType getQueryType() {
+ return QueryType.READ;
+ }
+
+ @Override
+ public <R, C> R accept(StatementVisitor<R, C> visitor, C context) {
+ return visitor.visitShowAvailableUrls(this, context);
+ }
+}
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/column/ColumnHeaderConstant.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/column/ColumnHeaderConstant.java
index 567df04301d..5214f2bfa76 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/column/ColumnHeaderConstant.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/column/ColumnHeaderConstant.java
@@ -456,6 +456,13 @@ public class ColumnHeaderConstant {
new ColumnHeader(DATA_REGION_NUM, TSDataType.INT32),
new ColumnHeader(SCHEMA_REGION_NUM, TSDataType.INT32));
+ public static final List<ColumnHeader> showAvailableUrlsColumnHeaders =
+ ImmutableList.of(
+ new ColumnHeader(NODE_ID, TSDataType.INT32),
+ new ColumnHeader(STATUS, TSDataType.TEXT),
+ new ColumnHeader(RPC_ADDRESS, TSDataType.TEXT),
+ new ColumnHeader(RPC_PORT, TSDataType.INT32));
+
public static final List<ColumnHeader> showConfigNodesColumnHeaders =
ImmutableList.of(
new ColumnHeader(NODE_ID, TSDataType.INT32),
diff --git
a/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
b/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
index f7f5517dcc2..e96f24eff5a 100644
---
a/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
+++
b/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
@@ -113,6 +113,7 @@ statement
| showClusterStatement
| showRegionsStatement
| showDataNodesStatement
+ | showAvailableUrlsStatement
| showConfigNodesStatement
| showAINodesStatement
| showClusterIdStatement
@@ -541,6 +542,10 @@ showDataNodesStatement
: SHOW DATANODES
;
+showAvailableUrlsStatement
+ : SHOW AVAILABLE URLS
+ ;
+
showConfigNodesStatement
: SHOW CONFIGNODES
;
@@ -1454,6 +1459,8 @@ DATABASE: 'DATABASE';
DATABASES: 'DATABASES';
DATANODE: 'DATANODE';
DATANODES: 'DATANODES';
+AVAILABLE: 'AVAILABLE';
+URLS: 'URLS';
DATASET: 'DATASET';
DATE: 'DATE';
DATE_BIN: 'DATE_BIN';