This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch ml/thrift
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit f5de3e52b42dff377ceff085f64c812df28e2ef4
Author: Minghui Liu <[email protected]>
AuthorDate: Mon Dec 12 19:09:39 2022 +0800

    add interface
---
 .../src/main/thrift/confignode.thrift              | 62 +++++++++++++++++++-
 thrift-mlnode/pom.xml                              | 67 ++++++++++++++++++++++
 thrift-mlnode/src/main/thrift/mlnode.thrift        | 41 +++++++++++++
 thrift/src/main/thrift/datanode.thrift             | 16 ++++++
 4 files changed, 184 insertions(+), 2 deletions(-)

diff --git a/thrift-confignode/src/main/thrift/confignode.thrift 
b/thrift-confignode/src/main/thrift/confignode.thrift
index 3515f372f8..a02985df51 100644
--- a/thrift-confignode/src/main/thrift/confignode.thrift
+++ b/thrift-confignode/src/main/thrift/confignode.thrift
@@ -626,6 +626,24 @@ struct TUnsetSchemaTemplateReq{
   3: required string path
 }
 
+struct TCreateModelReq {}
+
+struct TDropModelReq {}
+
+struct TShowModelReq {}
+
+struct TShowModelResp {}
+
+struct TShowTrailReq {}
+
+struct TShowTrailResp {}
+
+struct TGetModelInfoReq {}
+
+struct TGetModelInfoResp {}
+
+struct TUpdateModelInfoReq {}
+
 service IConfigNodeRPCService {
 
   // ======================================================
@@ -1090,7 +1108,7 @@ service IConfigNodeRPCService {
   /**
    * Create a CQ
    *
-   * @return SUCCESS_STATUS if the trigger was created successfully
+   * @return SUCCESS_STATUS if the cq was created successfully
    */
   common.TSStatus createCQ(TCreateCQReq req)
 
@@ -1102,8 +1120,48 @@ service IConfigNodeRPCService {
   common.TSStatus dropCQ(TDropCQReq req)
 
   /**
-   * Return the trigger table of config leader
+   * Return the cq table of config leader
    */
   TShowCQResp showCQ()
+
+  // ====================================================
+  // ML Model
+  // ====================================================
+
+  /**
+   * Create a model
+   *
+   * @return SUCCESS_STATUS if the model was created successfully
+   */
+  common.TSStatus createModel(TCreateModelReq req)
+
+  /**
+   * Drop a model
+   *
+   * @return SUCCESS_STATUS if the model was removed successfully
+   */
+  common.TSStatus dropModel(TDropModelReq req)
+
+  /**
+   * Return the model table
+   */
+  TShowModelResp showModel(TShowModelReq req)
+
+  /**
+   * Return the trail table
+   */
+  TShowTrailResp showTrail(TShowTrailReq req)
+
+  /**
+   * Return the model info by specific model id
+   */
+  TGetModelInfoResp getModelInfo(TGetModelInfoReq req)
+
+  /**
+   * Update the model info
+   *
+   * @return SUCCESS_STATUS if the model was removed successfully
+   */
+  common.TSStatus updateModelInfo(TUpdateModelInfoReq req)
 }
 
diff --git a/thrift-mlnode/pom.xml b/thrift-mlnode/pom.xml
new file mode 100644
index 0000000000..bda3ee1f30
--- /dev/null
+++ b/thrift-mlnode/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>iotdb-parent</artifactId>
+        <version>1.0.1-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>iotdb-thrift-mlnode</artifactId>
+    <name>rpc-thrift-mlnode</name>
+    <description>RPC (Thrift) framework among MLNodes.</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.thrift</groupId>
+            <artifactId>libthrift</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-thrift-commons</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>3.2.0</version>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                
<source>${project.build.directory}/generated-sources/thrift</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/thrift-mlnode/src/main/thrift/mlnode.thrift 
b/thrift-mlnode/src/main/thrift/mlnode.thrift
new file mode 100644
index 0000000000..a0a7641c4c
--- /dev/null
+++ b/thrift-mlnode/src/main/thrift/mlnode.thrift
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+include "common.thrift"
+namespace py iotdb.thrift.mlnode
+
+struct TCreateTrainingTaskReq {}
+
+struct TDeleteModelReq {}
+
+struct TForecastReq {}
+
+struct TForecastResp {}
+
+service IMLNodeRPCService {
+
+    // -------------- For Config Node --------------
+
+    common.TSStatus createTrainingTask(TCreateTrainingTaskReq req)
+
+    common.TSStatus deleteModel(TDeleteModelReq req)
+
+    // -------------- For Data Node --------------
+
+    TForecastResp forecast(TForecastReq req)
+}
\ No newline at end of file
diff --git a/thrift/src/main/thrift/datanode.thrift 
b/thrift/src/main/thrift/datanode.thrift
index 59f69ac81f..87f6519a38 100644
--- a/thrift/src/main/thrift/datanode.thrift
+++ b/thrift/src/main/thrift/datanode.thrift
@@ -351,6 +351,14 @@ struct TExecuteCQ {
   7: required string username
 }
 
+struct TDeleteModelMetricsReq {}
+
+struct TFetchWindowBatchReq {}
+
+struct TFetchWindowBatchResp {}
+
+struct TRecordModelMetricsReq {}
+
 service IDataNodeRPCService {
 
   // -----------------------------------For Data 
Node-----------------------------------------------
@@ -642,6 +650,14 @@ service IDataNodeRPCService {
   * Execute CQ on DataNode
   */
   common.TSStatus executeCQ(TExecuteCQ req)
+
+  common.TSStatus deleteModelMetrics(TDeleteModelMetricsReq req)
+
+  // ----------------------------------- For ML Node 
-----------------------------------------------
+
+  TFetchWindowBatchResp fetchWindowBatch(TFetchWindowBatchReq req)
+
+  common.TSStatus recordModelMetrics(TRecordModelMetricsReq req)
 }
 
 service MPPDataExchangeService {

Reply via email to