This is an automated email from the ASF dual-hosted git repository.
rong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 05b5de8515 [IOTDB-3161] Add <API Comparison> under the <API> of iotdb
official website. (#5866)
05b5de8515 is described below
commit 05b5de8515b3055b5f8450e48e3bc1662c923d25
Author: swpulk <[email protected]>
AuthorDate: Thu May 12 18:20:35 2022 +0800
[IOTDB-3161] Add <API Comparison> under the <API> of iotdb official
website. (#5866)
Co-authored-by: swpulk <[email protected]>
---
docs/UserGuide/API/Interface-Comparison.md | 50 +++++++++++++++++++++++++++
docs/zh/UserGuide/API/Interface-Comparison.md | 50 +++++++++++++++++++++++++++
site/src/main/.vuepress/config.js | 12 ++++---
3 files changed, 108 insertions(+), 4 deletions(-)
diff --git a/docs/UserGuide/API/Interface-Comparison.md
b/docs/UserGuide/API/Interface-Comparison.md
new file mode 100644
index 0000000000..14761497af
--- /dev/null
+++ b/docs/UserGuide/API/Interface-Comparison.md
@@ -0,0 +1,50 @@
+<!--
+
+ 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.
+
+-->
+
+# Native API Comparison
+
+This chapter mainly compares the differences between Java Native API and
python native API, mainly for the convenience of distinguishing the differences
between Java Native API and python native API.
+
+
+
+| Order | API name and function | Java API
| Python API
| <div style="width: 200pt">API Comparison</div>
|
+| ----- | ------------------------------------- |
------------------------------------------------------------ |
:----------------------------------------------------------- |
------------------------------------------------------------ |
+| 1 | Initialize session | `Session.Builder.build();
Session.Builder().host(String host).port(int port).build();
Session.Builder().nodeUrls(List<String> nodeUrls).build();
Session.Builder().fetchSize(int fetchSize).username(String
username).password(String password).thriftDefaultBufferSize(int
thriftDefaultBufferSize).thriftMaxFrameSize(int
thriftMaxFrameSize).enableCacheLeader(boolean
enableCacheLeader).version(Version version).build();` | `Session [...]
+| 2 | Open session | `void open() void
open(boolean enableRPCCompression)` |
`session.open(enable_rpc_compression=False)` |
|
+| 3 | Close session | `void close()`
| `session.close()`
| |
+| 4 | Set storage group | `void setStorageGroup(String
storageGroupId)` | `session.set_storage_group(group_name)`
| |
+| 5 | Delete storage group | `void
deleteStorageGroup(String storageGroup) void
deleteStorageGroups(List<String> storageGroups)` |
`session.delete_storage_group(group_name)
session.delete_storage_groups(group_name_lst)` |
|
+| 6 | Create timeseries | `void
createTimeseries(String path, TSDataType dataType,TSEncoding encoding,
CompressionType compressor, Map<String, String> props,Map<String, String>
tags, Map<String, String> attributes, String measurementAlias)
void createMultiTimeseries(List<String> paths, List<TSDataType>
dataTypes,List<TSEncoding> encodings, List<CompressionType>
compressors,List<Map<String, String>> propsList, List<Map<String, String>>
tagsList,Li [...]
+| 7 | Create aligned timeseries | `void
createAlignedTimeseries(String prefixPath, List<String>
measurements,List<TSDataType> dataTypes, List<TSEncoding>
encodings,CompressionType compressor, List<String> measurementAliasList);` |
`session.create_aligned_time_series(device_id, measurements_lst,
data_type_lst, encoding_lst, compressor_lst)` |
|
+| 8 | Delete timeseries | `void
deleteTimeseries(String path) void deleteTimeseries(List<String> paths)` |
`session.delete_time_series(paths_list)` | Python native
API is missing an API to delete a time series |
+| 9 | Detect whether the timeseries exists | `boolean
checkTimeseriesExists(String path)` |
`session.check_time_series_exists(path)` |
|
+| 10 | Metadata template | `public void
createSchemaTemplate(Template template);` |
|
|
+| 11 | Insert tablet | `void insertTablet(Tablet
tablet) void insertTablets(Map<String, Tablet> tablets)` |
`session.insert_tablet(tablet_) session.insert_tablets(tablet_lst)` |
|
+| 12 | Insert record | `void insertRecord(String
prefixPath, long time, List<String> measurements,List<TSDataType> types,
List<Object> values) void insertRecords(List<String> deviceIds,List<Long>
times,List<List<String>> measurementsList,List<List<TSDataType>>
typesList,List<List<Object>> valuesList) void
insertRecordsOfOneDevice(String deviceId, List<Long> times,List<List<Object>>
valuesList)` | `session.insert_record(device_id, timestamp, measur [...]
+| 13 | Write with type inference | `void insertRecord(String
prefixPath, long time, List<String> measurements, List<String> values)
void insertRecords(List<String> deviceIds, List<Long> times,List<List<String>>
measurementsList, List<List<String>> valuesList) void
insertStringRecordsOfOneDevice(String deviceId, List<Long>
times,List<List<String>> measurementsList, List<List<String>> valuesList)` |
`session.insert_str_record(device_id, timestamp, measurements [...]
+| 14 | Write of aligned time series | `insertAlignedRecord
insertAlignedRecords insertAlignedRecordsOfOneDevice
insertAlignedStringRecordsOfOneDevice insertAlignedTablet
insertAlignedTablets` | `insert_aligned_record insert_aligned_records
insert_aligned_records_of_one_device insert_aligned_tablet
insert_aligned_tablets` | Python native API is missing the writing of aligned
time series with judgment type |
+| 15 | Data deletion | `void deleteData(String
path, long endTime) void deleteData(List<String> paths, long endTime)` |
| 1. The python
native API lacks an API to delete a piece of data<br/>2. The python native API
lacks an API to delete multiple pieces of data |
+| 16 | Data query | `SessionDataSet
executeRawDataQuery(List<String> paths, long startTime, long endTime)
SessionDataSet executeLastDataQuery(List<String> paths, long LastTime)` |
| 1. The python native
API lacks an API for querying the original data<br/>2. The python native API
lacks an API to query the data whose last timestamp is greater than or equal to
a certain time point |
+| 17 | Iotdb SQL API - query statement | `SessionDataSet
executeQueryStatement(String sql)` |
`session.execute_query_statement(sql)` |
|
+| 18 | Iotdb SQL API - non query statement | `void
executeNonQueryStatement(String sql)` |
`session.execute_non_query_statement(sql)` |
|
+| 19 | Test API | `void
testInsertRecord(String deviceId, long time, List<String> measurements,
List<String> values) void testInsertRecord(String deviceId, long time,
List<String> measurements,List<TSDataType> types, List<Object> values)
void testInsertRecords(List<String> deviceIds, List<Long>
times,List<List<String>> measurementsList, List<List<String>> valuesList)
void testInsertRecords(List<String> deviceIds, List<Long> times,List<List [...]
+| 20 | Connection pool for native interfaces | `SessionPool`
|
| Python API has no connection pool for native API |
+| 21 | API related to cluster information | `iotdb-thrift-cluster`
|
| Python API does not support interfaces related to cluster
information |
\ No newline at end of file
diff --git a/docs/zh/UserGuide/API/Interface-Comparison.md
b/docs/zh/UserGuide/API/Interface-Comparison.md
new file mode 100644
index 0000000000..89ae996304
--- /dev/null
+++ b/docs/zh/UserGuide/API/Interface-Comparison.md
@@ -0,0 +1,50 @@
+<!--
+
+ 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.
+
+-->
+
+# 原生接口对比
+
+此章节主要为Java原生接口与Python原生接口的差异性对比,主要为方便区分Java原生接口与Python原生的不同之处。
+
+
+
+| 序号 | 接口名称以及作用 | Java接口函数
| Python接口函数 | <div
style="width: 200pt">接口对比说明</div>
|
+| ---- | ------------------------- |
------------------------------------------------------------ |
------------------------------------------------------------ |
------------------------------------------------------------ |
+| 1 | 初始化Session | `Session.Builder.build();
Session.Builder().host(String host).port(int port).build();
Session.Builder().nodeUrls(List<String> nodeUrls).build();
Session.Builder().fetchSize(int fetchSize).username(String
username).password(String password).thriftDefaultBufferSize(int
thriftDefaultBufferSize).thriftMaxFrameSize(int
thriftMaxFrameSize).enableCacheLeader(boolean
enableCacheLeader).version(Version version).build();` | `Session(ip, port_,
user [...]
+| 2 | 开启 Session | `void open() void open(boolean
enableRPCCompression)` | `session.open(enable_rpc_compression=False)`
| |
+| 3 | 关闭 Session | `void close()`
| `session.close()`
| |
+| 4 | 设置存储组 | `void setStorageGroup(String storageGroupId)`
| `session.set_storage_group(group_name)` |
|
+| 5 | 删除存储组 | `void deleteStorageGroup(String storageGroup)
void deleteStorageGroups(List<String> storageGroups)` |
`session.delete_storage_group(group_name)
session.delete_storage_groups(group_name_lst)` |
|
+| 6 | 创建时间序列 | `void createTimeseries(String path, TSDataType
dataType,TSEncoding encoding, CompressionType compressor, Map<String, String>
props,Map<String, String> tags, Map<String, String> attributes, String
measurementAlias) void createMultiTimeseries(List<String> paths,
List<TSDataType> dataTypes,List<TSEncoding> encodings, List<CompressionType>
compressors,List<Map<String, String>> propsList, List<Map<String, String>>
tagsList,List<Map<String, Str [...]
+| 7 | 创建对齐时间序列 | `void createAlignedTimeseries(String prefixPath,
List<String> measurements,List<TSDataType> dataTypes, List<TSEncoding>
encodings,CompressionType compressor, List<String> measurementAliasList);` |
`session.create_aligned_time_series(device_id, measurements_lst,
data_type_lst, encoding_lst, compressor_lst)` |
|
+| 8 | 删除时间序列 | `void deleteTimeseries(String path) void
deleteTimeseries(List<String> paths)` |
`session.delete_time_series(paths_list)` |
Python原生接口缺少删除一个时间序列的接口 |
+| 9 | 检测时间序列是否存在 | `boolean checkTimeseriesExists(String path)`
| `session.check_time_series_exists(path)` |
|
+| 10 | 元数据模版 | `public void createSchemaTemplate(Template
template);` |
| |
+| 11 | 插入Tablet | `void insertTablet(Tablet tablet) void
insertTablets(Map<String, Tablet> tablets)` | `session.insert_tablet(tablet_)
session.insert_tablets(tablet_lst)` |
|
+| 12 | 插入Record | `void insertRecord(String prefixPath, long
time, List<String> measurements,List<TSDataType> types, List<Object> values)
void insertRecords(List<String> deviceIds,List<Long>
times,List<List<String>> measurementsList,List<List<TSDataType>>
typesList,List<List<Object>> valuesList) void
insertRecordsOfOneDevice(String deviceId, List<Long> times,List<List<Object>>
valuesList)` | `session.insert_record(device_id, timestamp, measurements_,
data_t [...]
+| 13 | 带有类型推断的写入 | `void insertRecord(String prefixPath, long time,
List<String> measurements, List<String> values) void
insertRecords(List<String> deviceIds, List<Long> times,List<List<String>>
measurementsList, List<List<String>> valuesList) void
insertStringRecordsOfOneDevice(String deviceId, List<Long>
times,List<List<String>> measurementsList, List<List<String>> valuesList)` |
`session.insert_str_record(device_id, timestamp, measurements, string_values)`
| 1. [...]
+| 14 | 对齐时间序列的写入 | `insertAlignedRecord insertAlignedRecords
insertAlignedRecordsOfOneDevice insertAlignedStringRecordsOfOneDevice
insertAlignedTablet insertAlignedTablets` | `insert_aligned_record
insert_aligned_records insert_aligned_records_of_one_device
insert_aligned_tablet insert_aligned_tablets` |
Python原生接口缺少带有判断类型的对齐时间序列的写入 |
+| 15 | 数据删除 | `void deleteData(String path, long endTime)
void deleteData(List<String> paths, long endTime)` |
| 1.Python原生接口缺少删除一条数据的接口
2.Python原生接口缺少删除多条数据的接口 |
+| 16 | 数据查询 | `SessionDataSet
executeRawDataQuery(List<String> paths, long startTime, long endTime)
SessionDataSet executeLastDataQuery(List<String> paths, long LastTime)` |
|
1.Python原生接口缺少原始数据查询的接口 2.Python原生接口缺少查询最后一条时间戳大于等于某个时间点的数据的接口 |
+| 17 | IoTDB-SQL 接口-查询语句 | `SessionDataSet executeQueryStatement(String
sql)` | `session.execute_query_statement(sql)` |
|
+| 18 | IoTDB-SQL 接口-非查询语句 | `void executeNonQueryStatement(String sql)`
| `session.execute_non_query_statement(sql)` |
|
+| 19 | 测试接口 | `void testInsertRecord(String deviceId, long
time, List<String> measurements, List<String> values) void
testInsertRecord(String deviceId, long time, List<String>
measurements,List<TSDataType> types, List<Object> values) void
testInsertRecords(List<String> deviceIds, List<Long> times,List<List<String>>
measurementsList, List<List<String>> valuesList) void
testInsertRecords(List<String> deviceIds, List<Long> times,List<List<String>>
measur [...]
+| 20 | 针对原生接口的连接池 | `SessionPool`
| |
Python接口无针对原生接口的连接池 |
+| 21 | 集群信息相关的接口 | `iotdb-thrift-cluster`
| |
Python接口不支持集群信息相关的接口 |
\ No newline at end of file
diff --git a/site/src/main/.vuepress/config.js
b/site/src/main/.vuepress/config.js
index d29e8f0913..22c7b08676 100644
--- a/site/src/main/.vuepress/config.js
+++ b/site/src/main/.vuepress/config.js
@@ -703,7 +703,8 @@ var config = {
['API/Programming-MQTT','MQTT'],
['API/RestService','REST API'],
['API/Programming-TsFile-API','TsFile API'],
-
['API/Status-Codes','Status Codes']
+
['API/Status-Codes','Status Codes'],
+
['API/Interface-Comparison', 'Interface Comparison']
]
},
{
@@ -880,7 +881,8 @@ var config = {
['API/RestService','REST API'],
['API/Programming-TsFile-API','TsFile API'],
['API/InfluxDB-Protocol','InfluxDB Protocol'],
-
['API/Status-Codes','Status Codes']
+
['API/Status-Codes','Status Codes'],
+
['API/Interface-Comparison', 'Interface Comparison']
]
},
{
@@ -1624,7 +1626,8 @@ var config = {
['API/Programming-MQTT','MQTT'],
['API/RestService','REST API'],
['API/Programming-TsFile-API','TsFile API'],
-
['API/Status-Codes','状态码']
+
['API/Status-Codes','状态码'],
+
['API/Interface-Comparison', '原生接口对比']
]
},
{
@@ -1801,7 +1804,8 @@ var config = {
['API/RestService','REST API'],
['API/Programming-TsFile-API','TsFile API'],
['API/InfluxDB-Protocol','InfluxDB 协议适配器'],
-
['API/Status-Codes','状态码']
+
['API/Status-Codes','状态码'],
+
['API/Interface-Comparison', '原生接口对比']
]
},
{