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

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


The following commit(s) were added to refs/heads/update_rpc_protocol by this 
push:
     new 6232e1a  set rpc version to v3
6232e1a is described below

commit 6232e1a55bca37e7b529f1b7b2dcbce4ab4d287e
Author: xiangdong huang <[email protected]>
AuthorDate: Mon Jun 29 14:51:53 2020 +0800

    set rpc version to v3
---
 client-py/src/client_example.py                             |  2 +-
 .../main/java/org/apache/iotdb/jdbc/IoTDBConnection.java    |  2 +-
 .../java/org/apache/iotdb/db/service/TSServiceImpl.java     |  9 ++++++---
 service-rpc/rpc-changelist.md                               | 13 +++++++++++--
 service-rpc/src/main/thrift/rpc.thrift                      |  3 ++-
 session/src/main/java/org/apache/iotdb/session/Session.java |  2 +-
 6 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/client-py/src/client_example.py b/client-py/src/client_example.py
index 9f27a2c..f7f79b0 100755
--- a/client-py/src/client_example.py
+++ b/client-py/src/client_example.py
@@ -178,7 +178,7 @@ if __name__ == '__main__':
     transport.open()
 
     # Authentication
-    clientProtocol = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V2
+    clientProtocol = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3
     resp = client.openSession(TSOpenSessionReq(client_protocol=clientProtocol,
                                                username=username,
                                                password=password))
diff --git a/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java 
b/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
index ebf98e0..b240050 100644
--- a/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
+++ b/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
@@ -56,7 +56,7 @@ import org.slf4j.LoggerFactory;
 public class IoTDBConnection implements Connection {
 
   private static final Logger logger = 
LoggerFactory.getLogger(IoTDBConnection.class);
-  private static final TSProtocolVersion protocolVersion = 
TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V2;
+  private static final TSProtocolVersion protocolVersion = 
TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3;
   private TSIService.Iface client = null;
   private long sessionId = -1;
   private IoTDBConnectionParams params;
diff --git 
a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java 
b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index 7aec45c..0adc2c6 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -154,6 +154,9 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
   // When the client abnormally exits, we can still know who to disconnect
   private ThreadLocal<Long> currSessionId = new ThreadLocal<>();
 
+  public static final TSProtocolVersion CURRENT_RPC_VERSION = 
TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3;
+
+
   public TSServiceImpl() throws QueryProcessException {
     processor = new Planner();
     executor = new PlanExecutor();
@@ -190,7 +193,7 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
         tsStatus = RpcUtils.getStatus(TSStatusCode.INCOMPATIBLE_VERSION,
             "The version is incompatible, please upgrade to " + 
IoTDBConstant.VERSION);
         TSOpenSessionResp resp = new TSOpenSessionResp(tsStatus,
-            TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V2);
+            CURRENT_RPC_VERSION);
         resp.setSessionId(sessionId);
         return resp;
       }
@@ -206,7 +209,7 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
     }
     auditLogger.info("User {} opens Session-{}", req.getUsername(), sessionId);
     TSOpenSessionResp resp = new TSOpenSessionResp(tsStatus,
-        TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V2);
+        CURRENT_RPC_VERSION);
     resp.setSessionId(sessionId);
     logger.info(
         "{}: Login status: {}. User : {}", IoTDBConstant.GLOBAL_DB_NAME, 
tsStatus.message,
@@ -216,7 +219,7 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
   }
 
   private boolean checkCompatibility(TSProtocolVersion version) {
-    return version.equals(TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V2);
+    return version.equals(CURRENT_RPC_VERSION);
   }
 
   @Override
diff --git a/service-rpc/rpc-changelist.md b/service-rpc/rpc-changelist.md
index dacb452..aaf8ebe 100644
--- a/service-rpc/rpc-changelist.md
+++ b/service-rpc/rpc-changelist.md
@@ -21,7 +21,8 @@
 
 # 0.10.x (version-2) -> 0.11.x (version-3)
 
-Last Updated on 2020-6-15 by Tian Jiang.
+Last Updated on 2020-6-29 by Xiangdong Huang.
+
 
 ## 1. Delete Old
 
@@ -30,14 +31,21 @@ Last Updated on 2020-6-15 by Tian Jiang.
 | Remove TSBatchExecuteStatementResp            | Tian Jiang         |
 
 
-
 ## 2. Add New
 
+| Latest Changes                                               | Related 
Committers     |
+| ------------------------------------------------------------ | 
---------------------- |
+| set the input/output as TFramedTransport      |  Tian Jiang        |
+
+
 ## 3. Update
 
 | Latest Changes                                               | Related 
Committers     |
 | ------------------------------------------------------------ | 
---------------------- |
 | Add sub-status in TSStatus  | Tian Jiang  |
+| Change the result of executeBatchStatement  as   TSStatus    | Tian Jiang  |
+
+
 
 
 # 0.9.x (version-1) -> 0.10.x (version-2)
@@ -62,6 +70,7 @@ Last Updated on 2020-5-25 by Kaifeng Xue.
 | Add struct TSInsertTabletsReq                            | Jialin Qiao|
 | Add method insertTablets                            | Jialin Qiao|
 | Add method testInsertTablets                            | Xiangdong Huang |
+| add new field `inferType` in TSInsertRecordReq  | Jialin Qiao      |
 
 ## 3. Update
 
diff --git a/service-rpc/src/main/thrift/rpc.thrift 
b/service-rpc/src/main/thrift/rpc.thrift
index 25bdcd8..64cb9ee 100644
--- a/service-rpc/src/main/thrift/rpc.thrift
+++ b/service-rpc/src/main/thrift/rpc.thrift
@@ -43,6 +43,7 @@ struct TSExecuteStatementResp {
 enum TSProtocolVersion {
   IOTDB_SERVICE_PROTOCOL_V1,
   IOTDB_SERVICE_PROTOCOL_V2,//V2 is the first version that we can check 
version compatibility
+  IOTDB_SERVICE_PROTOCOL_V3,//V3 is incompatible with V2
 }
 
 struct TSOpenSessionResp {
@@ -61,7 +62,7 @@ struct TSOpenSessionResp {
 // OpenSession()
 // Open a session (connection) on the server against which operations may be 
executed.
 struct TSOpenSessionReq {
-  1: required TSProtocolVersion client_protocol = 
TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V2
+  1: required TSProtocolVersion client_protocol = 
TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3
   2: optional string username
   3: optional string password
   4: optional map<string, string> configuration
diff --git a/session/src/main/java/org/apache/iotdb/session/Session.java 
b/session/src/main/java/org/apache/iotdb/session/Session.java
index 43bacda..5bb573e 100644
--- a/session/src/main/java/org/apache/iotdb/session/Session.java
+++ b/session/src/main/java/org/apache/iotdb/session/Session.java
@@ -68,7 +68,7 @@ import org.slf4j.LoggerFactory;
 public class Session {
 
   private static final Logger logger = LoggerFactory.getLogger(Session.class);
-  private final TSProtocolVersion protocolVersion = 
TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V2;
+  private final TSProtocolVersion protocolVersion = 
TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3;
   private String host;
   private int port;
   private String username;

Reply via email to