You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/07/03 01:46:58 UTC

[incubator-iotdb] branch master updated: [IOTDB-787] set thrift and antlr as two independent module (#1451)

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

qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 5f08035  [IOTDB-787] set thrift and antlr as two independent module (#1451)
5f08035 is described below

commit 5f08035f8760d58248e4aa1228649dd451ff0b64
Author: Xiangdong Huang <hu...@tsinghua.edu.cn>
AuthorDate: Fri Jul 3 09:46:49 2020 +0800

    [IOTDB-787] set thrift and antlr as two independent module (#1451)
    
    * set thrift and antlr as two independent module
    Co-authored-by: xiangdong huang <sa...@gmail.com>
---
 README.md                                          |   2 +-
 README_ZH.md                                       |   2 +-
 antlr/pom.xml                                      |  55 +++++++++++
 .../org/apache/iotdb/db/qp/strategy/SqlBase.g4     |   0
 client-py/compile.bat                              |   2 +-
 client-py/compile.sh                               |   2 +-
 client-py/readme.md                                |   2 +-
 client-py/src/client_example.py                    |   2 +-
 docs/Development/ContributeGuide.md                |   6 +-
 docs/SystemDesign/Client/RPC.md                    |  11 ++-
 docs/SystemDesign/QueryEngine/Planner.md           |   6 +-
 .../Client/Programming - Other Languages.md        |   2 +-
 docs/UserGuide/Server/Download.md                  |   2 +-
 docs/zh/Development/ContributeGuide.md             |   4 +-
 docs/zh/SystemDesign/Client/RPC.md                 |  12 ++-
 docs/zh/SystemDesign/QueryEngine/Planner.md        |   4 +-
 .../Client/Programming - Other Languages.md        |   2 +-
 jdbc/src/main/feature/feature.xml                  |   1 +
 pom.xml                                            |   2 +
 server/pom.xml                                     |  21 +---
 service-rpc/pom.xml                                | 108 +--------------------
 site/pom.xml                                       |   4 +-
 {service-rpc => thrift}/pom.xml                    |  69 +------------
 {service-rpc => thrift}/rpc-changelist.md          |   3 -
 .../src/main/thrift/cluster.thrift                 |   0
 {service-rpc => thrift}/src/main/thrift/rpc.thrift |   0
 .../src/main/thrift/sync.thrift                    |   0
 {service-rpc => thrift}/src/pypi/README.md         |   2 +-
 {service-rpc => thrift}/src/pypi/setup.py          |   0
 29 files changed, 112 insertions(+), 214 deletions(-)

diff --git a/README.md b/README.md
index 38d652b..2b60983 100644
--- a/README.md
+++ b/README.md
@@ -129,7 +129,7 @@ Under the root path of incubator-iotdb:
 
 Then the binary version (including both server and cli) can be found at **distribution/target/apache-iotdb-{project.version}-incubating-bin.zip**
 
-> NOTE: Directories "service-rpc/target/generated-sources/thrift" and "server/target/generated-sources/antlr4" need to be added to sources roots to avoid compilation errors in the IDE.
+> NOTE: Directories "thrift/target/generated-sources/thrift" and "antlr/target/generated-sources/antlr4" need to be added to sources roots to avoid compilation errors in the IDE.
 
 ### Configurations
 
diff --git a/README_ZH.md b/README_ZH.md
index 4c4566f..07987f3 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -126,7 +126,7 @@ git checkout release/x.x.x
 
 执行完成之后,可以在**distribution/target/apache-iotdb-{project.version}-incubating-bin.zip**找到编译完成的二进制版本(包括服务器和客户端)
 
-> 注意:"service-rpc/target/generated-sources/thrift" 和 "server/target/generated-sources/antlr4" 目录需要添加到源代码根中,以免在 IDE 中产生编译错误。
+> 注意:"thrift/target/generated-sources/thrift" 和 "antlr/target/generated-sources/antlr4" 目录需要添加到源代码根中,以免在 IDE 中产生编译错误。
 
 ### 配置
 
diff --git a/antlr/pom.xml b/antlr/pom.xml
new file mode 100644
index 0000000..3d9da5f
--- /dev/null
+++ b/antlr/pom.xml
@@ -0,0 +1,55 @@
+<?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>0.11.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>iotdb-antlr</artifactId>
+    <name>sql-antlr</name>
+    <description>Antlr parser for IoTDB.</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.antlr</groupId>
+            <artifactId>antlr4-runtime</artifactId>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.antlr</groupId>
+                <artifactId>antlr4-maven-plugin</artifactId>
+                <version>${antlr4.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>antlr4</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
similarity index 100%
rename from server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
rename to antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
diff --git a/client-py/compile.bat b/client-py/compile.bat
index dca7559..7b8532f 100644
--- a/client-py/compile.bat
+++ b/client-py/compile.bat
@@ -20,7 +20,7 @@
 @echo off
 set THRIFT_EXE=D:\software\Thrift\thrift-0.13.0.exe
 set BAT_DIR=%~dp0
-set THRIFT_SCRIPT=%BAT_DIR%..\service-rpc\src\main\thrift\rpc.thrift
+set THRIFT_SCRIPT=%BAT_DIR%..\thrift\src\main\thrift\rpc.thrift
 set THRIFT_OUT=%BAT_DIR%target\iotdb
 
 rmdir /Q /S %THRIFT_OUT%
diff --git a/client-py/compile.sh b/client-py/compile.sh
index 93b107c..63426c6 100644
--- a/client-py/compile.sh
+++ b/client-py/compile.sh
@@ -20,7 +20,7 @@
 
 export THRIFT_EXE=thrift
 export SH_DIR=$(dirname $0)/
-export THRIFT_SCRIPT=${SH_DIR}../service-rpc/src/main/thrift/rpc.thrift
+export THRIFT_SCRIPT=${SH_DIR}../thrift/src/main/thrift/rpc.thrift
 export THRIFT_OUT=${SH_DIR}target/iotdb
 
 rm -rf ${THRIFT_OUT}
diff --git a/client-py/readme.md b/client-py/readme.md
index 576cae7..2c4946d 100644
--- a/client-py/readme.md
+++ b/client-py/readme.md
@@ -42,7 +42,7 @@ locate the thrift source file by relative path, so if you move the scripts else
 no longer valid.
 
 Optionally, if you know the basic usage of thrift, you can only download the thrift source file in
-`service-rpc\src\main\thrift\rpc.thrift`, and simply use `thrift -gen py -out ./target/iotdb rpc.thrift` 
+`thrift\src\main\thrift\rpc.thrift`, and simply use `thrift -gen py -out ./target/iotdb rpc.thrift` 
 to generate the python library.
 
 ## Example
diff --git a/client-py/src/client_example.py b/client-py/src/client_example.py
index f7f79b0..b729e37 100755
--- a/client-py/src/client_example.py
+++ b/client-py/src/client_example.py
@@ -25,7 +25,7 @@ import struct
 # sys.path.append("../target")
 
 #if you use maven to compile the thrift api, just use the follwoing code:
-sys.path.append("../../service-rpc/target/generated-sources-python")
+sys.path.append("../../thrift/target/generated-sources-python")
 
 from thrift.protocol import TBinaryProtocol, TCompactProtocol
 from thrift.transport import TSocket, TTransport
diff --git a/docs/Development/ContributeGuide.md b/docs/Development/ContributeGuide.md
index 959420e..2e5ae1e 100644
--- a/docs/Development/ContributeGuide.md
+++ b/docs/Development/ContributeGuide.md
@@ -19,7 +19,7 @@
 
 -->
 
-# 一、work process
+# 1. work process
 
 ## Main link
 
@@ -95,9 +95,9 @@ You can go to jira to pick up the existing issue or create your own issue and ge
 * Make changes based on other people's reviews and continue to update until merged
 * close jira issue
 
-## 二、IoTDB debugging method
+## 2. IoTDB debugging method
 
-Recommended Use Intellij idea。```mvn clean package -DskipTests``` After putting ```server/target/generated-sources/antlr4``` and ```service-rpc/target/generated-sources/thrift``` marked as ```Source Root```。 
+Recommended Use Intellij idea. ```mvn clean package -DskipTests``` After putting ```antlr/target/generated-sources/antlr4``` and ```thrift/target/generated-sources/thrift``` marked as ```Source Root```。 
 
 * Server main function:```server/src/main/java/org/apache/iotdb/db/service/IoTDB```,Can be started in debug mode
 * Client:```client/src/main/java/org/apache/iotdb/client/```,Use Clinet for linux and WinClint for windows, you can start directly, need the parameter "-h 127.0.0.1 -p 6667 -u root -pw root"
diff --git a/docs/SystemDesign/Client/RPC.md b/docs/SystemDesign/Client/RPC.md
index 68f45ea..a46aada 100644
--- a/docs/SystemDesign/Client/RPC.md
+++ b/docs/SystemDesign/Client/RPC.md
@@ -23,7 +23,7 @@
 
 We use thrift rpc between client and server, the definition file is :
 
-service-rpc/src/main/thrift/rpc.thrift
+thrift/src/main/thrift/rpc.thrift
 
 You can add struct and corresponding method in TSIService (service)
 
@@ -33,9 +33,16 @@ You can add struct and corresponding method in TSIService (service)
 mvn clean compile -pl service-rpc -am -DskipTests
 ```
 
+or
+
+```
+mvn clean compile -pl thrift
+
+```
+
 Generated codes:
 
-service-rpc/target/generated-sources/thrift/org/apache/iotdb/service/rpc/thrift
+thrift/target/generated-sources/thrift/org/apache/iotdb/service/rpc/thrift
 
 ## Implement the new interface
 
diff --git a/docs/SystemDesign/QueryEngine/Planner.md b/docs/SystemDesign/QueryEngine/Planner.md
index d2a63a0..c62dc11 100644
--- a/docs/SystemDesign/QueryEngine/Planner.md
+++ b/docs/SystemDesign/QueryEngine/Planner.md
@@ -29,11 +29,11 @@ Transform the syntax tree parsed by SQL into logical plans, logical optimization
 
 SQL parsing using Antlr4
 
-* server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
+* antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
 
-mvn clean compile 
+`mvn clean compile -pl antlr` 
 
-Generated code location :server/target/generated-sources/antlr4
+Generated code location :antlr/target/generated-sources/antlr4
 
 ## Logical plan generator
 
diff --git a/docs/UserGuide/Client/Programming - Other Languages.md b/docs/UserGuide/Client/Programming - Other Languages.md
index 005289a..4a98dd8 100644
--- a/docs/UserGuide/Client/Programming - Other Languages.md	
+++ b/docs/UserGuide/Client/Programming - Other Languages.md	
@@ -63,7 +63,7 @@ no longer valid.
 #### Option 3: basic usage of thrift
 
 Optionally, if you know the basic usage of thrift, you can only download the thrift source file in
-`service-rpc\src\main\thrift\rpc.thrift`, and simply use `thrift -gen py -out ./target/iotdb rpc.thrift` 
+`thrift\src\main\thrift\rpc.thrift`, and simply use `thrift -gen py -out ./target/iotdb rpc.thrift` 
 to generate the python library.
 
 ### 4. Use Example
diff --git a/docs/UserGuide/Server/Download.md b/docs/UserGuide/Server/Download.md
index c3f6776..f38b4fd 100644
--- a/docs/UserGuide/Server/Download.md
+++ b/docs/UserGuide/Server/Download.md
@@ -59,7 +59,7 @@ Under the root path of incubator-iotdb:
 
 Then the binary version (including both server and client) can be found at **distribution/target/apache-iotdb-{project.version}-incubating-bin.zip**
 
-> NOTE: Directories "service-rpc/target/generated-sources/thrift" and "server/target/generated-sources/antlr4" need to be added to sources roots to avoid compilation errors in IDE.
+> NOTE: Directories "thrift/target/generated-sources/thrift" and "antlr/target/generated-sources/antlr4" need to be added to sources roots to avoid compilation errors in IDE.
 
 If you would like to build the IoTDB server, you can run the following command under the root path of incubator-iotdb:
 
diff --git a/docs/zh/Development/ContributeGuide.md b/docs/zh/Development/ContributeGuide.md
index 1f5871a..3dc82e4 100644
--- a/docs/zh/Development/ContributeGuide.md
+++ b/docs/zh/Development/ContributeGuide.md
@@ -101,7 +101,9 @@ IoTDB 所有官网上的内容都在项目根目录的 docs 中:
 
 ### Intellij idea
 
-推荐使用 Intellij idea。```mvn clean package -DskipTests``` 之后把 ```server/target/generated-sources/antlr4``` 和 ```service-rpc/target/generated-sources/thrift``` 标记为 ```Source Root```。 
+推荐使用 Intellij idea。```mvn clean package -DskipTests``` 
+
+之后把 ```antlr/target/generated-sources/antlr4``` 和 ```thrift/target/generated-sources/thrift``` 标记为 ```Source Root```。 
 
 ### Eclipse
 
diff --git a/docs/zh/SystemDesign/Client/RPC.md b/docs/zh/SystemDesign/Client/RPC.md
index 5a63894..d1406f3 100644
--- a/docs/zh/SystemDesign/Client/RPC.md
+++ b/docs/zh/SystemDesign/Client/RPC.md
@@ -23,7 +23,7 @@
 
 我们使用 Thrift Rpc 框架, thrift 定义文件目录:
 
-service-rpc/src/main/thrift/rpc.thrift
+thrift/src/main/thrift/rpc.thrift
 
 可按需增加 struct 结构,并在 service TSIService 中增加对应方法
 
@@ -33,9 +33,17 @@ service-rpc/src/main/thrift/rpc.thrift
 mvn clean compile -pl service-rpc -am -DskipTests
 ```
 
+或者
+
+
+```
+mvn clean compile -pl thrift
+
+```
+
 生成代码位置:
 
-service-rpc/target/generated-sources/thrift/org/apache/iotdb/service/rpc/thrift
+thrift/target/generated-sources/thrift/org/apache/iotdb/service/rpc/thrift
 
 ## 实现新接口
 
diff --git a/docs/zh/SystemDesign/QueryEngine/Planner.md b/docs/zh/SystemDesign/QueryEngine/Planner.md
index 82640d0..2eb8e1c 100644
--- a/docs/zh/SystemDesign/QueryEngine/Planner.md
+++ b/docs/zh/SystemDesign/QueryEngine/Planner.md
@@ -29,9 +29,9 @@
 
 SQL 解析采用 Antlr4
 
-* server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
+* antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
 
-mvn clean compile 之后生成代码位置:server/target/generated-sources/antlr4
+`mvn clean compile -pl antlr` 之后生成代码位置:antlr/target/generated-sources/antlr4
 
 ## 逻辑计划生成器
 
diff --git a/docs/zh/UserGuide/Client/Programming - Other Languages.md b/docs/zh/UserGuide/Client/Programming - Other Languages.md
index 735c8f4..dc1707f 100644
--- a/docs/zh/UserGuide/Client/Programming - Other Languages.md	
+++ b/docs/zh/UserGuide/Client/Programming - Other Languages.md	
@@ -59,7 +59,7 @@ pip install apache-iotdb
 #### 方案3:thrift的基本用法
 
 或者,如果您了解thrift的基本用法,则只能在以下位置下载Thrift源文件:
-`service-rpc\src\main\thrift\rpc.thrift`,并且只需使用`thrift -gen py -out ./target/iotdb rpc.thrift`生成python库。
+`thrift\src\main\thrift\rpc.thrift`,并且只需使用`thrift -gen py -out ./target/iotdb rpc.thrift`生成python库。
 
 ### 4. 示例代码
 
diff --git a/jdbc/src/main/feature/feature.xml b/jdbc/src/main/feature/feature.xml
index eda59ec..5704a7a 100644
--- a/jdbc/src/main/feature/feature.xml
+++ b/jdbc/src/main/feature/feature.xml
@@ -25,6 +25,7 @@
         <bundle>mvn:org.apache.iotdb/iotdb-jdbc/${project.version}</bundle>
         <bundle>mvn:org.apache.iotdb/tsfile/${project.version}</bundle>
         <bundle>mvn:org.apache.iotdb/service-rpc/${project.version}</bundle>
+        <bundle>mvn:org.apache.iotdb/iotdb-thrift/${project.version}</bundle>
         <bundle>mvn:org.apache.iotdb/hadoop-tsfile/${project.version}</bundle>
         <bundle>mvn:org.apache.thrift/libthrift/0.13.0</bundle>
         <bundle>mvn:org.xerial.snappy/snappy-java/1.1.7.2</bundle>
diff --git a/pom.xml b/pom.xml
index 2b39876..8e1fa53 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,6 +80,8 @@
     </mailingLists>
     <modules>
         <module>tsfile</module>
+        <module>antlr</module>
+        <module>thrift</module>
         <module>service-rpc</module>
         <module>jdbc</module>
         <module>session</module>
diff --git a/server/pom.xml b/server/pom.xml
index e617d3b..1b01e9b 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -55,6 +55,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-antlr</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
             <artifactId>tsfile</artifactId>
             <version>${project.version}</version>
             <exclusions>
@@ -79,10 +84,6 @@
             <artifactId>commons-lang</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.antlr</groupId>
-            <artifactId>antlr4-runtime</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
@@ -183,18 +184,6 @@
     </dependencies>
     <build>
         <plugins>
-            <plugin>
-                <groupId>org.antlr</groupId>
-                <artifactId>antlr4-maven-plugin</artifactId>
-                <version>${antlr4.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>antlr4</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <!--using `mvn test` to run UT, `mvn verify` to run ITs
                         Reference: https://antoniogoncalves.org/2012/12/13/lets-turn-integration-tests-with-maven-to-a-first-class-citizen/-->
             <plugin>
diff --git a/service-rpc/pom.xml b/service-rpc/pom.xml
index 6a2c57a..beb2a0c 100644
--- a/service-rpc/pom.xml
+++ b/service-rpc/pom.xml
@@ -37,12 +37,13 @@
     </properties>
     <dependencies>
         <dependency>
-            <groupId>org.apache.thrift</groupId>
-            <artifactId>libthrift</artifactId>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>tsfile</artifactId>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.iotdb</groupId>
-            <artifactId>tsfile</artifactId>
+            <artifactId>iotdb-thrift</artifactId>
             <version>${project.version}</version>
         </dependency>
     </dependencies>
@@ -130,111 +131,10 @@
                     <skipITs>${rpc.it.skip}</skipITs>
                 </configuration>
             </plugin>
-            <!-- for pypi distribution -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-resources-plugin</artifactId>
-                <version>2.4.3</version>
-                <configuration>
-                    <encoding>${project.build.sourceEncoding}</encoding>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>copy-pypi-resources</id>
-                        <!-- here the phase you need -->
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <encoding>utf-8</encoding>
-                            <outputDirectory>${project.build.directory}/generated-sources-python</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>${basedir}/src/pypi</directory>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>copy-license-resources</id>
-                        <!-- here the phase you need -->
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <encoding>utf-8</encoding>
-                            <outputDirectory>${project.build.directory}/generated-sources-python</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>${basedir}/../</directory>
-                                    <includes>
-                                        <include>LICENSE</include>
-                                    </includes>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
     <profiles>
         <profile>
-            <id>only-eclipse</id>
-            <activation>
-                <property>
-                    <name>m2e.version</name>
-                </property>
-            </activation>
-            <build>
-                <pluginManagement>
-                    <plugins>
-                        <plugin>
-                            <groupId>org.eclipse.m2e</groupId>
-                            <artifactId>lifecycle-mapping</artifactId>
-                            <version>1.0.0</version>
-                            <configuration>
-                                <lifecycleMappingMetadata>
-                                    <pluginExecutions>
-                                        <pluginExecution>
-                                            <pluginExecutionFilter>
-                                                <groupId>org.apache.maven.plugins</groupId>
-                                                <artifactId>maven-dependency-plugin</artifactId>
-                                                <versionRange>${maven-dependency-plugin.version}</versionRange>
-                                                <goals>
-                                                    <goal>copy-dependencies</goal>
-                                                </goals>
-                                            </pluginExecutionFilter>
-                                            <action>
-                                                <ignore/>
-                                            </action>
-                                        </pluginExecution>
-                                        <pluginExecution>
-                                            <pluginExecutionFilter>
-                                                <groupId>org.apache.thrift.tools</groupId>
-                                                <artifactId>maven-thrift-plugin</artifactId>
-                                                <versionRange>[0.1.10,)</versionRange>
-                                                <goals>
-                                                    <goal>compile</goal>
-                                                </goals>
-                                            </pluginExecutionFilter>
-                                            <action>
-                                                <execute>
-                                                    <runOnIncremental>false</runOnIncremental>
-                                                </execute>
-                                            </action>
-                                        </pluginExecution>
-                                    </pluginExecutions>
-                                </lifecycleMappingMetadata>
-                            </configuration>
-                        </plugin>
-                    </plugins>
-                </pluginManagement>
-            </build>
-        </profile>
-        <profile>
             <id>skipTsfileTests</id>
             <activation>
                 <property>
diff --git a/site/pom.xml b/site/pom.xml
index f85a744..c9cd77b 100644
--- a/site/pom.xml
+++ b/site/pom.xml
@@ -103,7 +103,7 @@
                                     </includes>
                                 </resource>
                                 <resource>
-                                    <directory>${basedir}/../service-rpc</directory>
+                                    <directory>${basedir}/../thrift</directory>
                                     <includes>
                                         <include>rpc-changelist.md</include>
                                     </includes>
@@ -129,7 +129,7 @@
                                     </includes>
                                 </resource>
                                 <resource>
-                                    <directory>${basedir}/../service-rpc</directory>
+                                    <directory>${basedir}/../thrift</directory>
                                     <includes>
                                         <include>rpc-changelist.md</include>
                                     </includes>
diff --git a/service-rpc/pom.xml b/thrift/pom.xml
similarity index 77%
copy from service-rpc/pom.xml
copy to thrift/pom.xml
index 6a2c57a..15632c1 100644
--- a/service-rpc/pom.xml
+++ b/thrift/pom.xml
@@ -27,24 +27,14 @@
         <version>0.11.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
-    <artifactId>service-rpc</artifactId>
-    <name>Service-rpc</name>
-    <description>RPC framework for client and server.</description>
-    <properties>
-        <rpc.test.skip>false</rpc.test.skip>
-        <rpc.it.skip>${rpc.test.skip}</rpc.it.skip>
-        <rpc.ut.skip>${rpc.test.skip}</rpc.ut.skip>
-    </properties>
+    <artifactId>iotdb-thrift</artifactId>
+    <name>rpc-thrift</name>
+    <description>RPC (Thrift) framework for client and server.</description>
     <dependencies>
         <dependency>
             <groupId>org.apache.thrift</groupId>
             <artifactId>libthrift</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.iotdb</groupId>
-            <artifactId>tsfile</artifactId>
-            <version>${project.version}</version>
-        </dependency>
     </dependencies>
     <build>
         <plugins>
@@ -103,33 +93,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <!--using `mvn test` to run UT, `mvn verify` to run ITs
-            Reference: https://antoniogoncalves.org/2012/12/13/lets-turn-integration-tests-with-maven-to-a-first-class-citizen/-->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <skipTests>${rpc.ut.skip}</skipTests>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-failsafe-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>run-integration-tests</id>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>integration-test</goal>
-                            <goal>verify</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <skipTests>${rpc.test.skip}</skipTests>
-                    <skipITs>${rpc.it.skip}</skipITs>
-                </configuration>
-            </plugin>
             <!-- for pypi distribution -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -234,31 +197,5 @@
                 </pluginManagement>
             </build>
         </profile>
-        <profile>
-            <id>skipTsfileTests</id>
-            <activation>
-                <property>
-                    <name>skipTests</name>
-                    <value>true</value>
-                </property>
-            </activation>
-            <properties>
-                <rpc.test.skip>true</rpc.test.skip>
-                <rpc.ut.skip>true</rpc.ut.skip>
-                <rpc.it.skip>true</rpc.it.skip>
-            </properties>
-        </profile>
-        <profile>
-            <id>skipUT_ServiceRPC_Tests</id>
-            <activation>
-                <property>
-                    <name>skipUTs</name>
-                    <value>true</value>
-                </property>
-            </activation>
-            <properties>
-                <rpc.ut.skip>true</rpc.ut.skip>
-            </properties>
-        </profile>
     </profiles>
 </project>
diff --git a/service-rpc/rpc-changelist.md b/thrift/rpc-changelist.md
similarity index 97%
rename from service-rpc/rpc-changelist.md
rename to thrift/rpc-changelist.md
index 5fc8cbf..aaf8ebe 100644
--- a/service-rpc/rpc-changelist.md
+++ b/thrift/rpc-changelist.md
@@ -36,8 +36,6 @@ Last Updated on 2020-6-29 by Xiangdong Huang.
 | Latest Changes                                               | Related Committers     |
 | ------------------------------------------------------------ | ---------------------- |
 | set the input/output as TFramedTransport      |  Tian Jiang        |
-| add TSInsertStringRecordReq and TSInsertStringRecordsReq struct     |  Jianlin Qiao   |
-| add insertStringRecord, insertStringRecords and related test methods  |  Jianlin Qiao   |
 
 
 ## 3. Update
@@ -46,7 +44,6 @@ Last Updated on 2020-6-29 by Xiangdong Huang.
 | ------------------------------------------------------------ | ---------------------- |
 | Add sub-status in TSStatus  | Tian Jiang  |
 | Change the result of executeBatchStatement  as   TSStatus    | Tian Jiang  |
-| Remove inferType from TSInsertRecordReq | Jialin Qiao |
 
 
 
diff --git a/service-rpc/src/main/thrift/cluster.thrift b/thrift/src/main/thrift/cluster.thrift
similarity index 100%
rename from service-rpc/src/main/thrift/cluster.thrift
rename to thrift/src/main/thrift/cluster.thrift
diff --git a/service-rpc/src/main/thrift/rpc.thrift b/thrift/src/main/thrift/rpc.thrift
similarity index 100%
rename from service-rpc/src/main/thrift/rpc.thrift
rename to thrift/src/main/thrift/rpc.thrift
diff --git a/service-rpc/src/main/thrift/sync.thrift b/thrift/src/main/thrift/sync.thrift
similarity index 100%
rename from service-rpc/src/main/thrift/sync.thrift
rename to thrift/src/main/thrift/sync.thrift
diff --git a/service-rpc/src/pypi/README.md b/thrift/src/pypi/README.md
similarity index 97%
rename from service-rpc/src/pypi/README.md
rename to thrift/src/pypi/README.md
index aefc22d..1e445d5 100644
--- a/service-rpc/src/pypi/README.md
+++ b/thrift/src/pypi/README.md
@@ -49,7 +49,7 @@ You have to install thrift (>=0.13) before using the package.
 
 ## How to use (Example)
 
-You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/incubator-iotdb/blob/release%2F0.9.0/client-py/src/client_example.py)
+You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/incubator-iotdb/blob/release%2F0.10.0/client-py/src/client_example.py)
 
 # DISCLAIMER
 
diff --git a/service-rpc/src/pypi/setup.py b/thrift/src/pypi/setup.py
similarity index 100%
rename from service-rpc/src/pypi/setup.py
rename to thrift/src/pypi/setup.py