You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2023/01/12 08:38:50 UTC
[iotdb] branch master updated: Update the user guide of Flink-IoTDB sink (#8848)
This is an automated email from the ASF dual-hosted git repository.
haonan 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 3299f1310e Update the user guide of Flink-IoTDB sink (#8848)
3299f1310e is described below
commit 3299f1310ec758d8203e1a526702bcb8a6c37d92
Author: 马子坤 <55...@users.noreply.github.com>
AuthorDate: Thu Jan 12 16:38:43 2023 +0800
Update the user guide of Flink-IoTDB sink (#8848)
---
docs/UserGuide/Ecosystem-Integration/Flink-IoTDB.md | 3 ++-
docs/zh/UserGuide/Ecosystem-Integration/Flink-IoTDB.md | 8 ++++----
.../src/main/java/org/apache/iotdb/flink/FlinkIoTDBSink.java | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/docs/UserGuide/Ecosystem-Integration/Flink-IoTDB.md b/docs/UserGuide/Ecosystem-Integration/Flink-IoTDB.md
index 5a5520a966..982f5631c8 100644
--- a/docs/UserGuide/Ecosystem-Integration/Flink-IoTDB.md
+++ b/docs/UserGuide/Ecosystem-Integration/Flink-IoTDB.md
@@ -38,6 +38,7 @@ This example shows a case that sends data to a IoTDB server from a Flink job:
It is noteworthy that to use IoTDBSink, schema auto-creation in IoTDB should be enabled.
```java
+import org.apache.iotdb.flink.options.IoTDBSinkOptions;
import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
@@ -74,7 +75,7 @@ public class FlinkIoTDBSink {
new IoTDBSink(options, serializationSchema)
// enable batching
.withBatchSize(10)
- // how many connectons to the server will be created for each parallelism
+ // how many connections to the server will be created for each parallelism
.withSessionPoolSize(3);
env.addSource(new SensorSource())
diff --git a/docs/zh/UserGuide/Ecosystem-Integration/Flink-IoTDB.md b/docs/zh/UserGuide/Ecosystem-Integration/Flink-IoTDB.md
index 28f97afb56..c94e4c59de 100644
--- a/docs/zh/UserGuide/Ecosystem-Integration/Flink-IoTDB.md
+++ b/docs/zh/UserGuide/Ecosystem-Integration/Flink-IoTDB.md
@@ -36,6 +36,7 @@ IoTDB 与 [Apache Flink](https://flink.apache.org/) 的集成。此模块包含
- Flink 使用 `IoTDBSink` 消费产生的数据并写入 IoTDB 。
```java
+ import org.apache.iotdb.flink.options.IoTDBSinkOptions;
import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
@@ -54,18 +55,17 @@ IoTDB 与 [Apache Flink](https://flink.apache.org/) 的集成。此模块包含
// run the flink job on local mini cluster
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
- IoTDBOptions options = new IoTDBOptions();
+ IoTDBSinkOptions options = new IoTDBSinkOptions();
options.setHost("127.0.0.1");
options.setPort(6667);
options.setUser("root");
options.setPassword("root");
- options.setStorageGroup("root.sg");
// If the server enables auto_create_schema, then we do not need to register all timeseries
// here.
options.setTimeseriesOptionList(
Lists.newArrayList(
- new IoTDBOptions.TimeseriesOption(
+ new IoTDBSinkOptions.TimeseriesOption(
"root.sg.d1.s1", TSDataType.DOUBLE, TSEncoding.GORILLA, CompressionType.SNAPPY)));
IoTSerializationSchema serializationSchema = new DefaultIoTSerializationSchema();
@@ -73,7 +73,7 @@ IoTDB 与 [Apache Flink](https://flink.apache.org/) 的集成。此模块包含
new IoTDBSink(options, serializationSchema)
// enable batching
.withBatchSize(10)
- // how many connectons to the server will be created for each parallelism
+ // how many connections to the server will be created for each parallelism
.withSessionPoolSize(3);
env.addSource(new SensorSource())
diff --git a/example/flink/src/main/java/org/apache/iotdb/flink/FlinkIoTDBSink.java b/example/flink/src/main/java/org/apache/iotdb/flink/FlinkIoTDBSink.java
index 9b72438284..1d80357693 100644
--- a/example/flink/src/main/java/org/apache/iotdb/flink/FlinkIoTDBSink.java
+++ b/example/flink/src/main/java/org/apache/iotdb/flink/FlinkIoTDBSink.java
@@ -61,7 +61,7 @@ public class FlinkIoTDBSink {
new IoTDBSink(options, serializationSchema)
// enable batching
.withBatchSize(10)
- // how many connectons to the server will be created for each parallelism
+ // how many connections to the server will be created for each parallelism
.withSessionPoolSize(3);
env.addSource(new SensorSource())