Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

# C# 原生接口

## 1 依赖
## 1. 依赖

- .NET SDK >= 5.0 或 .NET Framework 4.x
- Thrift >= 0.14.1
- NLog >= 4.7.9

## 2 安装
## 2. 安装

您可以使用 NuGet Package Manager, .NET CLI等工具来安装,以 .NET CLI为例

Expand All @@ -50,7 +50,7 @@ dotnet add package Apache.IoTDB.framework
dotnet add package Apache.IoTDB --version 0.12.1.2
```

## 3 基本接口说明
## 3. 基本接口说明

Session接口在语义上和其他语言客户端相同

Expand Down Expand Up @@ -88,7 +88,7 @@ await session_pool.InsertTabletAsync(tablet);
await session_pool.Close();
```

## 4 **Row Record**
## 4. **Row Record**

- 对**IoTDB**中的`record`数据进行封装和抽象。
- 示例:
Expand Down Expand Up @@ -124,7 +124,7 @@ var tablet =



## 5 **API**
## 5. **API**

### 5.1 **基础接口**

Expand Down Expand Up @@ -188,7 +188,7 @@ var tablet =

用法可以参考[用户示例](https://github.com/apache/iotdb-client-csharp/tree/main/samples/Apache.IoTDB.Samples)

## 6 连接池
## 6. 连接池

为了实现并发客户端请求,我们提供了针对原生接口的连接池(`SessionPool`),由于`SessionPool`本身为`Session`的超集,当`SessionPool`的`pool_size`参数设置为1时,退化为原来的`Session`

Expand All @@ -198,7 +198,7 @@ var tablet =

当一个连接被用完后,他会自动返回池中等待下次被使用

## 7 ByteBuffer
## 7. ByteBuffer

在传入RPC接口参数时,需要对Record和Tablet两种数据结构进行序列化,我们主要通过封装的ByteBuffer类实现

Expand Down Expand Up @@ -266,7 +266,7 @@ private void extend_buffer(int space_need){

通过上述的策略,我们在一个有`20000`行的Tablet上进行测试时,序列化速度相比Naive数组长度动态生长实现算法具有约35倍的性能加速。

## 8 异常重连
## 8. 异常重连

当服务端发生异常或者宕机重启时,客户端中原来通过`Open()`产生的的session会失效,抛出`TException`异常

Expand Down
10 changes: 5 additions & 5 deletions src/zh/UserGuide/Master/Tree/API/Programming-Cpp-Native-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# C++ 原生接口

## 1 依赖
## 1. 依赖

- Java 8+
- Flex
Expand All @@ -31,7 +31,7 @@
- GCC 5.5.0+


## 2 安装
## 2. 安装

### 2.1 安装相关依赖

Expand Down Expand Up @@ -163,7 +163,7 @@ A:
- 执行 `.\mvnw.cmd clean install`
- 回到 iotdb 代码目录执行 `.\mvnw.cmd clean package -pl example/client-cpp-example -am -DskipTests -P with-cpp -Dcmake.generator="Visual Studio 15 2017"`

## 3 基本接口说明
## 3. 基本接口说明

下面将给出 Session 接口的简要介绍和原型定义:

Expand Down Expand Up @@ -404,7 +404,7 @@ void executeNonQueryStatement(const std::string &sql);
```


## 4 示例代码
## 4. 示例代码

示例工程源代码:

Expand All @@ -413,7 +413,7 @@ void executeNonQueryStatement(const std::string &sql);

编译成功后,示例代码工程位于 `example/client-cpp-example/target`

## 5 FAQ
## 5. FAQ

### 5.1 Thrift 编译相关问题

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@

IoTDB 提供了强大的数据订阅功能,允许用户通过订阅 API 实时获取 IoTDB 新增的数据。详细的功能定义及介绍:[数据订阅](../User-Manual/Data-subscription.md)

## 1 核心步骤
## 1. 核心步骤

1. 创建Topic:创建一个Topic,Topic中包含希望订阅的测点。
2. 订阅Topic:在 consumer 订阅 topic 前,topic 必须已经被创建,否则订阅会失败。同一个 consumer group 下的 consumers 会均分数据。
3. 消费数据:只有显式订阅了某个 topic,才会收到对应 topic 的数据。
4. 取消订阅: consumer close 时会退出对应的 consumer group,同时取消现存的所有订阅。


## 2 详细步骤
## 2. 详细步骤

本章节用于说明开发的核心流程,并未演示所有的参数和接口,如需了解全部功能及参数请参见: [全量接口说明](./Programming-Java-Native-API.md#3-全量接口说明)

Expand Down Expand Up @@ -181,7 +181,7 @@ public class DataConsumerExample {



## 3 全量接口说明
## 3. 全量接口说明

### 3.1 参数列表

Expand Down
4 changes: 2 additions & 2 deletions src/zh/UserGuide/Master/Tree/API/Programming-Go-Native-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# Go 原生接口

## 1 依赖
## 1. 依赖

* golang >= 1.13
* make >= 3.0
Expand All @@ -30,7 +30,7 @@
* Linux、Macos 或其他类 unix 系统
* Windows+bash (下载 IoTDB Go client 需要 git ,通过 WSL、cygwin、Git Bash 任意一种方式均可)

## 2 安装方法
## 2. 安装方法

* 通过 go mod

Expand Down
4 changes: 2 additions & 2 deletions src/zh/UserGuide/Master/Tree/API/Programming-JDBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
*注意: 目前的JDBC实现仅是为与第三方工具连接使用的。使用JDBC(执行插入语句时)无法提供高性能写入。
对于Java应用,我们推荐使用[Java 原生接口](./Programming-Java-Native-API.md)*

## 1 依赖
## 1. 依赖

* JDK >= 1.8
* Maven >= 3.6

## 2 安装方法
## 2. 安装方法

在根目录下执行下面的命令:
```shell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ IoTDB 原生 API 中的 Session 是实现与数据库交互的核心接口,它

SessionPool 是 Session 的连接池,推荐使用SessionPool编程。在多线程并发的情形下,SessionPool 能够合理地管理和分配连接资源,以提升系统性能与资源利用效率。

## 1 步骤概览
## 1. 步骤概览

1. 创建连接池实例:初始化一个SessionPool对象,用于管理多个Session实例。
2. 执行操作:直接从SessionPool中获取Session实例,并执行数据库操作,无需每次都打开和关闭连接。
3. 关闭连接池资源:在不再需要进行数据库操作时,关闭SessionPool,释放所有相关资源。

## 2 详细步骤
## 2. 详细步骤

本章节用于说明开发的核心流程,并未演示所有的参数和接口,如需了解全部功能及参数请参见: [全量接口说明](./Programming-Java-Native-API.md#3-全量接口说明) 或 查阅: [源码](https://github.com/apache/iotdb/tree/master/example/session/src/main/java/org/apache/iotdb)

Expand Down Expand Up @@ -341,7 +341,7 @@ public class SessionPoolExample {
}
```

## 3 全量接口说明
## 3. 全量接口说明

### 3.1 参数列表

Expand Down
2 changes: 1 addition & 1 deletion src/zh/UserGuide/Master/Tree/API/Programming-Kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

[Apache Kafka](https://kafka.apache.org/) 是一个开源的分布式事件流平台,被数千家公司用于高性能数据管道、流分析、数据集成和关键任务应用。

## 1 示例代码
## 1. 示例代码

### 1.1 kafka 生产者生产数据 Java 代码示例

Expand Down
6 changes: 3 additions & 3 deletions src/zh/UserGuide/Master/Tree/API/Programming-MQTT.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ IoTDB 服务器包括内置的 MQTT 服务,该服务允许远程设备将消

<img style="width:100%; max-width:800px; max-height:600px; margin-left:auto; margin-right:auto; display:block;" src="/img/github/78357432-0c71cf80-75e4-11ea-98aa-c43a54d469ce.png">

## 1 内置 MQTT 服务
## 1. 内置 MQTT 服务
内置的 MQTT 服务提供了通过 MQTT 直接连接到 IoTDB 的能力。 它侦听来自 MQTT 客户端的发布消息,然后立即将数据写入存储。
MQTT 主题与 IoTDB 时间序列相对应。
消息有效载荷可以由 Java SPI 加载的`PayloadFormatter`格式化为事件,默认实现为`JSONPayloadFormatter`
Expand All @@ -59,7 +59,7 @@ MQTT 主题与 IoTDB 时间序列相对应。

<img style="width:100%; max-width:800px; max-height:600px; margin-left:auto; margin-right:auto; display:block;" src="/img/github/78357469-1bf11880-75e4-11ea-978f-a53996667a0d.png">

## 2 MQTT 配置
## 2. MQTT 配置
默认情况下,IoTDB MQTT 服务从`${IOTDB_HOME}/${IOTDB_CONF}/iotdb-system.properties`加载配置。

配置如下:
Expand Down Expand Up @@ -101,7 +101,7 @@ connection.disconnect();
```


## 3 自定义 MQTT 消息格式
## 3. 自定义 MQTT 消息格式

事实上可以通过简单编程来实现 MQTT 消息的格式自定义。
可以在源码的 `example/mqtt-customize` 项目中找到一个简单示例。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
IoTDB 使用 Thrift 作为跨语言的 RPC 框架,因此可以通过 Thrift 提供的接口来实现对 IoTDB 的访问。本文档将介绍如何生成可访问 IoTDB 的原生 Node.js 接口。


## 1 依赖
## 1. 依赖

* JDK >= 1.8
* Node.js >= 16.0.0
Expand All @@ -40,7 +40,7 @@ http://thrift.apache.org/docs/install/
```


## 2 编译 thrift 库,生成 Node.js 原生接口
## 2. 编译 thrift 库,生成 Node.js 原生接口

1. 在 IoTDB 源代码文件夹的根目录中找到 pom.xml 文件。
2. 打开 pom.xml 文件,找到以下内容:
Expand Down Expand Up @@ -86,12 +86,12 @@ http://thrift.apache.org/docs/install/

**注意**不要将`iotdb/iotdb-protocol/thrift/target` 和 `iotdb/iotdb-protocol/thrift-commons/target`上传到 git 仓库中 !

## 3 使用 Node.js 原生接口
## 3. 使用 Node.js 原生接口

将 `iotdb/iotdb-protocol/thrift/target/generated-sources-nodejs/` 和 `iotdb/iotdb-protocol/thrift-commons/target/generated-sources-nodejs/` 中的文件复制到您的项目中,即可使用。


## 4 支持的 rpc 接口
## 4. 支持的 rpc 接口

```
// 打开一个 session
Expand Down
4 changes: 2 additions & 2 deletions src/zh/UserGuide/Master/Tree/API/Programming-ODBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
# ODBC
在 JDBC 插件的基础上,IoTDB 可以通过 ODBC-JDBC 桥来支持通过 ODBC 对数据库的操作。

## 1 依赖
## 1. 依赖
* 带依赖打包的 IoTDB JDBC 插件包
* ODBC-JDBC 桥(如 Zappy-Sys)

## 2 部署方法
## 2. 部署方法
### 2.1 准备 JDBC 插件包
下载 IoTDB 源码,在根目录下执行下面的命令:
```shell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# OPC UA 协议

## 1 OPC UA
## 1. OPC UA

OPC UA 是一种在自动化领域用于不同设备和系统之间进行通信的技术规范,用于实现跨平台、跨语言和跨网络的操作,为工业物联网提供一个可靠和安全的数据交换基础。IoTDB 中支持 OPC UA协议, IoTDB OPC Server 支持 Client/Server 和 Pub/Sub 两种通信模式。

Expand Down Expand Up @@ -62,7 +62,7 @@ OPC UA 是一种在自动化领域用于不同设备和系统之间进行通信

- Event 仅会发送给所有已经监听的客户端,客户端未连接则会忽略该 Event。

## 2 IoTDB OPC Server 启动方式
## 2. IoTDB OPC Server 启动方式

### 2.1 语法

Expand Down Expand Up @@ -117,7 +117,7 @@ start pipe p1;

4. **不支持删除数据和修改测点类型:**在Client Server模式下,OPC UA无法删除数据或者改变数据类型的设置。而在Pub Sub模式下,如果数据被删除了,信息是无法推送给客户端的。

## 3 IoTDB OPC Server 示例
## 3. IoTDB OPC Server 示例

### 3.1 Client / Server 模式

Expand Down
Loading