You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2020/06/28 13:30:53 UTC

[incubator-iotdb] branch rel/0.10 updated (6474694 -> 538cd5a)

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

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


    from 6474694  fix insert tablet serialize (#1404)
     new 735841e  fix python client example that be inconsistent with Server's thrift Transport instance
     new 538cd5a  fix pypi iotdb module version to 0.10.0

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 client-py/src/client_example.py | 17 ++++++++++++-----
 service-rpc/src/pypi/README.md  |  2 +-
 service-rpc/src/pypi/setup.py   |  4 ++--
 3 files changed, 15 insertions(+), 8 deletions(-)
 mode change 100644 => 100755 client-py/src/client_example.py


[incubator-iotdb] 01/02: fix python client example that be inconsistent with Server's thrift Transport instance

Posted by hx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 735841e86138660a8da2c36f380216525a834090
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Mon Jun 22 20:40:05 2020 +0800

    fix python client example that be inconsistent with Server's thrift Transport instance
---
 client-py/src/client_example.py | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/client-py/src/client_example.py b/client-py/src/client_example.py
old mode 100644
new mode 100755
index 3c8f65a..b20f372
--- a/client-py/src/client_example.py
+++ b/client-py/src/client_example.py
@@ -20,9 +20,14 @@ import sys
 import struct
 
 # If you generate IoTDB python library manually, add it to your python path
-sys.path.append("../target")
 
-from thrift.protocol import TBinaryProtocol
+#for example, if you run compile.sh, you can use the following code:
+# 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")
+
+from thrift.protocol import TBinaryProtocol, TCompactProtocol
 from thrift.transport import TSocket, TTransport
 
 from iotdb.rpc.TSIService import Client, TSCreateTimeseriesReq, TSInsertRecordReq, \
@@ -159,9 +164,11 @@ if __name__ == '__main__':
     transport = TSocket.TSocket(ip, port)
 
     # Buffering is critical. Raw sockets are very slow
-    transport = TTransport.TBufferedTransport(transport)
+    transport = TTransport.TFramedTransport(transport)
 
     # Wrap in a protocol
+    # use TCompactProtocol if the server enable thrift compression,
+    # otherwise use TBinaryProtocol
     protocol = TBinaryProtocol.TBinaryProtocol(transport)
 
     # Create a client to use the protocol encoder
@@ -278,8 +285,8 @@ if __name__ == '__main__':
     resp = client.insertTablet(TSInsertTabletReq(sessionId,deviceId,
                                                   measurements, values,
                                                   times, dataTypes, rowCnt))
-    status = resp.statusList
-    print(status[0].message)
+    status = resp.code
+    print(status)
 
     # execute deletion (or other statements)
     resp = client.executeStatement(TSExecuteStatementReq(sessionId, "DELETE FROM "


[incubator-iotdb] 02/02: fix pypi iotdb module version to 0.10.0

Posted by hx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 538cd5aaa9316c1be2270fe857d54d147a8f828f
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Sun Jun 28 21:30:31 2020 +0800

    fix pypi iotdb module version to 0.10.0
---
 service-rpc/src/pypi/README.md | 2 +-
 service-rpc/src/pypi/setup.py  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/service-rpc/src/pypi/README.md b/service-rpc/src/pypi/README.md
index 34cd717..742baa0 100644
--- a/service-rpc/src/pypi/README.md
+++ b/service-rpc/src/pypi/README.md
@@ -51,7 +51,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/rel/0.10/client-py/src/client_example.py)
 
 # DISCLAIMER
 
diff --git a/service-rpc/src/pypi/setup.py b/service-rpc/src/pypi/setup.py
index ed93720..19e4db0 100644
--- a/service-rpc/src/pypi/setup.py
+++ b/service-rpc/src/pypi/setup.py
@@ -31,7 +31,7 @@ print(long_description)
 
 setuptools.setup(
     name="apache-iotdb", # Replace with your own username
-    version="0.9.0",
+    version="0.10.0",
     author=" Apache Software Foundation",
     author_email="dev@iotdb.apache.org",
     description="Apache IoTDB (incubating) client API",
@@ -40,7 +40,7 @@ setuptools.setup(
     url="https://github.com/apache/incubator-iotdb",
     packages=setuptools.find_packages(),
     install_requires=[
-              'thrift',
+              'thrift>=0.13.0',
           ],
     classifiers=[
         "Programming Language :: Python :: 3",