-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement ExternalService Framework #17009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Weihao Li <[email protected]>
Signed-off-by: Weihao Li <[email protected]>
Signed-off-by: Weihao Li <[email protected]>
Signed-off-by: Weihao Li <[email protected]>
Signed-off-by: Weihao Li <[email protected]>
Signed-off-by: Weihao Li <[email protected]>
JackieTien97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
partial review, finish CN and antlr parts.
...lational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
Show resolved
Hide resolved
iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-system.properties
Outdated
Show resolved
Hide resolved
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Weihao Li <[email protected]>
JackieTien97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add all ITs you list in the documents and the recovery process is missing
.../node-commons/src/main/java/org/apache/iotdb/commons/schema/column/ColumnHeaderConstant.java
Outdated
Show resolved
Hide resolved
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/ServiceType.java
Outdated
Show resolved
Hide resolved
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode.java
Outdated
Show resolved
Hide resolved
...ode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
Show resolved
Hide resolved
...rg/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
Outdated
Show resolved
Hide resolved
...rg/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
Outdated
Show resolved
Hide resolved
...rg/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
Show resolved
Hide resolved
...tanode/src/main/java/org/apache/iotdb/db/service/exernalservice/BuiltinExternalServices.java
Outdated
Show resolved
Hide resolved
...tanode/src/main/java/org/apache/iotdb/db/service/exernalservice/BuiltinExternalServices.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Weihao Li <[email protected]>
Signed-off-by: Weihao Li <[email protected]>
Signed-off-by: Weihao Li <[email protected]>
Signed-off-by: Weihao Li <[email protected]>
Signed-off-by: Weihao Li <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a comprehensive ExternalService Framework that enables management of both built-in and user-defined services in IoTDB. The framework provides complete lifecycle management (create, start, stop, drop, show) for services through SQL statements, with persistence on ConfigNode and execution on DataNode.
Changes:
- Adds Thrift protocol definitions for external service communication between nodes
- Implements SQL grammar for service management operations (CREATE/START/STOP/DROP/SHOW SERVICE)
- Creates service management infrastructure on both DataNode and ConfigNode with consensus-based persistence
Reviewed changes
Copilot reviewed 78 out of 78 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| datanode.thrift, confignode.thrift, common.thrift | Defines Thrift structures and RPC methods for service communication |
| RelationalSql.g4, IoTDBSqlParser.g4 | Adds SQL grammar rules for service management statements |
| ServiceInfo.java | Core data structure representing service state and metadata |
| ExternalServiceManagementService.java | DataNode service managing local service instances |
| ExternalServiceManager.java, ExternalServiceInfo.java | ConfigNode components for global service coordination |
| IExternalService.java | API interface for implementing external services |
| ShowExternalServiceTask.java, etc. | Query execution tasks for service operations |
| IoTDBServicesIT.java | Integration tests validating service functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 1: required string serviceName | ||
| 2: required string className | ||
| 3: required byte state | ||
| 4: required i32 dataNodId |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'dataNodId' to 'dataNodeId'.
...c/main/java/org/apache/iotdb/db/service/exernalservice/ExternalServiceManagementService.java
Outdated
Show resolved
Hide resolved
.../db/queryengine/plan/execution/config/metadata/externalservice/StartExternalServiceTask.java
Outdated
Show resolved
Hide resolved
| TExternalServiceEntry externalServiceEntry, ColumnBuilder[] columnBuilders) { | ||
| columnBuilders[0].writeBinary( | ||
| new Binary(externalServiceEntry.getServiceName(), TSFileConfig.STRING_CHARSET)); | ||
| columnBuilders[1].writeInt(externalServiceEntry.getDataNodId()); |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected method name from 'getDataNodId' to 'getDataNodeId'.
...e/src/main/java/org/apache/iotdb/confignode/manager/externalservice/ExternalServiceInfo.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/iotdb/db/service/exernalservice/ExternalServiceManagementService.java
Outdated
Show resolved
Hide resolved
...g/apache/iotdb/confignode/consensus/request/read/exernalservice/ShowExternalServicePlan.java
Show resolved
Hide resolved
...test/java/org/apache/iotdb/relational/it/query/recent/informationschema/IoTDBServicesIT.java
Outdated
Show resolved
Hide resolved
| throws IOException { | ||
| int length = ReadWriteIOUtils.readInt(inputStream); | ||
| byte[] bytes = new byte[length]; | ||
| inputStream.read(bytes); |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method deserializeServiceInfoConsiderCRC ignores exceptional return value of InputStream.read.
| inputStream.read(bytes); | |
| int offset = 0; | |
| while (offset < length) { | |
| int read = inputStream.read(bytes, offset, length - offset); | |
| if (read == -1) { | |
| throw new IOException("Unexpected end of stream while reading service info."); | |
| } | |
| offset += read; | |
| } |
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
Show resolved
Hide resolved
Signed-off-by: Weihao Li <[email protected]>
don't persist on CN when start or stop built-in service Signed-off-by: Weihao Li <[email protected]>
No description provided.