liyuheng55555 commented on code in PR #15892:
URL: https://github.com/apache/iotdb/pull/15892#discussion_r2204438088
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java:
##########
@@ -453,6 +455,14 @@ protected IConfigTask visitShowAINodes(
return new ShowAINodesTask();
}
+ @Override
+ protected IConfigTask visitShowProcedures(
+ final ShowProcedures showProceduresStatement, final MPPQueryContext
context) {
+ context.setQueryType(QueryType.READ);
+ accessControl.checkUserIsAdmin(context.getSession().getUserName());
+ return new ShowProcedureTask();
+ }
Review Comment:
Other SHOW statements are generally use the MAINTAIN privilege, so I suggest
referring to that here.
##########
iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4:
##########
@@ -64,7 +64,7 @@ ddlStatement
| showVariables | showCluster | showRegions | showDataNodes |
showConfigNodes | showClusterId
| getRegionId | getTimeSlotList | countTimeSlotList | getSeriesSlotList
| migrateRegion | reconstructRegion | extendRegion | removeRegion |
removeDataNode | removeConfigNode
- | verifyConnection
+ | verifyConnection | showProcedures
Review Comment:
Maybe move this define to line 64, stay with other "show xxx"?
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java:
##########
@@ -2123,6 +2125,27 @@ public Pair<Long, Boolean> checkDuplicateTableTask(
return new Pair<>(-1L, false);
}
+ public List<TProcedureInfo> getProcedureInfoList() {
+ List<TProcedureInfo> procedureInfoList = new ArrayList<>();
+ ConcurrentHashMap<Long, Procedure<ConfigNodeProcedureEnv>> procedures =
+ this.getExecutor().getProcedures();
+ for (Map.Entry<Long, Procedure<ConfigNodeProcedureEnv>> procedureEntry :
+ procedures.entrySet()) {
+ TProcedureInfo procedureInfo = new TProcedureInfo();
+ Procedure<ConfigNodeProcedureEnv> procedure = procedureEntry.getValue();
+ procedureInfo.setProcId(procedureEntry.getKey());
+ procedureInfo.setStatus(procedure.getState().name());
+ procedureInfo.setSubmittedTime(procedure.getSubmittedTime());
+ procedureInfo.setLastUpdate(procedure.getLastUpdate());
+ procedureInfo.setParentProcId(procedure.getParentProcId());
+ procedureInfo.setClassName(procedure.getClass().getName());
+ procedureInfo.setState(procedure.getCurrentStateForDisplay());
+ procedureInfo.setProgress(procedure.getProgressForDisplay());
Review Comment:
Add a function like `toTProcedureInfo()` to Procedure.java ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]