Skip to content
Open
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
61 changes: 54 additions & 7 deletions .github/workflows/compile-check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow will compile IoTDB under jdk8 to check for compatibility issues
# Build Java integrations on the minimum supported JDK and the next LTS.

name: Compile Check

Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [8, 11, 17, 21]
java: [17, 21]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
Expand All @@ -47,9 +47,56 @@ jobs:
java-version: ${{ matrix.java }}
- name: Compiler Test
shell: bash
run: mvn clean verify -Pwith-springboot,with-all-connectors,with-examples,with-thingsboard,with-grafana-connector -ntp
- name: Spring Boot 4 Starter Test
shell: bash
run: mvn clean test -Pwith-springboot,spring-boot4 -pl iotdb-spring-boot-starter -am -ntp
- name: Spring Boot 4 MyBatis-Plus Test
shell: bash
run: mvn clean test -Pwith-examples,with-springboot,spring-boot4 -pl examples/mybatisplus-generator -am -ntp

mybatis-integration:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
profiles: [iotdb-mybatis-it, 'iotdb-mybatis-it,spring-boot4']
services:
iotdb:
image: apache/iotdb:2.0.11-standalone
env:
MEMORY_SIZE: 1G
# The image binds the client RPC service to 127.0.0.1 by default, which the
# published port cannot reach; bind to all interfaces like the Testcontainers ITs do.
dn_rpc_address: 0.0.0.0
ports:
- 6667:6667
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 17
cache: maven
- name: Wait for IoTDB to accept client sessions
# A TCP probe passes as soon as the port is published, several seconds before the
# DataNode can open a session, so wait for a real client round trip instead.
run: |
if [ "${{ matrix.java }}" -ge 17 ]; then
mvn clean verify -P with-springboot -P with-all-connectors -P with-examples -P with-thingsboard -ntp
else
mvn clean verify -P with-all-connectors -P with-examples -ntp
fi
for attempt in $(seq 1 120); do
if docker exec "${{ job.services.iotdb.id }}" timeout 15 /iotdb/sbin/start-cli.sh \
-h 127.0.0.1 -p 6667 -u root -pw root -e 'SHOW VERSION' >/dev/null 2>&1; then
echo "IoTDB accepted a client session after ${attempt} attempt(s)"
exit 0
fi
sleep 2
done
echo 'IoTDB did not accept a client session within 4 minutes' >&2
docker logs "${{ job.services.iotdb.id }}" 2>&1 | tail -n 100
exit 1
- name: Generate, compile and execute MyBatis mappers
run: >-
mvn verify -Pwith-examples,with-springboot,${{ matrix.profiles }}
-pl examples/mybatis-generator,examples/mybatisplus-generator -am
'-Diotdb.it.url=jdbc:iotdb://127.0.0.1:6667/?sql_dialect=table'
-Diotdb.it.precision=ms
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pipeline {

tools {
maven 'maven_3_latest'
jdk 'jdk_11_latest'
jdk 'jdk_17_latest'
}

options {
Expand Down
31 changes: 25 additions & 6 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ IoTDB (物联网数据库) 是一个专为物联网 (IoT) 场景设计的时序

7. **示例**:展示 IoTDB 与各种技术结合使用的示例应用程序和代码示例

IoTDB Java 依赖统一为 **2.0.11**,配套 **TsFile 2.4.0**、**Thrift 0.23.0**。Extras 自身版本仍为 `2.0.4-SNAPSHOT`,依赖基准为主仓库已发布的 `v2.0.11` 标签。

JDK 17 是最低要求,JDK 21 也纳入 CI。外部引擎需要单独确认对所选 JDK 的支持情况,尤其是 Spark 2.4/Scala 2.11 模块,部署到 JDK 17 前仍需完成运行时迁移。

## 环境要求

- Java 8+ (JDK 1.8 或更高版本,springboot 需要 JDK 17+,推荐使用 JDK 17+)
- JDK 17+:所有 Java 模块的构建和运行基线,CI 覆盖 JDK 17 和 21
- Maven 3.6 或更高版本
- Git

Expand All @@ -85,7 +89,7 @@ IoTDB (物联网数据库) 是一个专为物联网 (IoT) 场景设计的时序
2. 使用 Maven 构建项目:

```bash
# 构建整个项目(包括 distributions、iotdb-collector、metric-scrape、mybatis-generator)
# 构建整个项目(包括 distributions、iotdb-collector、metric-scrape、mybatis-generator、mybatis-support
mvn clean package -DskipTests

# 或者构建所有组件
Expand All @@ -106,6 +110,12 @@ IoTDB-Extras 使用 Maven profiles 配置不同的构建选项。您可以组合
mvn clean package -Pwith-springboot -DskipTests
```

Starter 默认使用 Spring Boot 3.5.1。使用下面的命令验证同一个 starter 在 Spring Boot 4.1.1 下的兼容性:

```bash
mvn clean test -Pwith-springboot,spring-boot4 -pl iotdb-spring-boot-starter -am
```

- **with-examples**:构建示例应用程序(建议与连接器 Profiles 一起使用)

```bash
Expand All @@ -132,6 +142,12 @@ IoTDB-Extras 使用 Maven profiles 配置不同的构建选项。您可以组合
mvn clean package -Pwith-flink -DskipTests
```

- **with-mybatis**:将 MyBatis 生成插件和运行时适配打包为分发 zip

```bash
mvn clean package -Pwith-mybatis -DskipTests
```

- **with-grafana**:构建 Grafana 连接器和插件

```bash
Expand Down Expand Up @@ -266,8 +282,9 @@ mvn clean package -Pwith-all-connectors,with-examples,with-springboot -DskipTest

- **简介**:展示如何使用 iotdb-spring-boot-starter
- **版本**:
- IoTDB: 2.0.3
- iotdb-spring-boot-starter: 2.0.3
- IoTDB: 2.0.11
- iotdb-spring-boot-starter: 2.0.4-SNAPSHOT
- Starter 构建线:默认 Spring Boot 3.5.1;CI 已验证 Spring Boot 4.1.1
- **设置**:
1. 安装 IoTDB
2. 创建必要的数据库和表
Expand All @@ -292,8 +309,8 @@ mvn clean package -Pwith-all-connectors,with-examples,with-springboot -DskipTest

- **简介**:展示如何使用 IoTDB-Mybatis-Generator
- **版本**:
- IoTDB: 2.0.2
- mybatis-generator-plugin: 1.3.2
- IoTDB: 2.0.11
- mybatis-generator-plugin: 2.0.4-SNAPSHOT
- **设置**:
1. 安装并启动 IoTDB
2. 创建必要的数据库和表
Expand All @@ -304,6 +321,8 @@ mvn clean package -Pwith-all-connectors,with-examples,with-springboot -DskipTest
- [Flink 示例](/examples/flink/README.md)
- [Spark 表示例](/examples/spark-table/README.md)
- [MyBatis 生成器示例](/examples/mybatis-generator/README.md)
- [MyBatis 运行时查询与类型适配](/mybatis-support/README.md)
- [MyBatis-Plus / Spring Boot 3、4 示例](/examples/mybatisplus-generator/README.md)
- [IoTDB Spring Boot Starter 示例](/examples/iotdb-spring-boot-start/README.md)
- [Kafka 示例](/examples/kafka/readme.md)

Expand Down
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@ This repository includes:

## Prerequisites

- Java 8+ (JDK 1.8 or later versions, springboot requires JDK 17+, Recommended JDK 17+)
- JDK 17+ for building and running Java modules; CI covers JDK 17 and 21
- Maven 3.6 or later
- Git

IoTDB Java dependencies use **2.0.11**, paired with **TsFile 2.4.0** and **Thrift 0.23.0**. Extras keeps its own artifact version (`2.0.4-SNAPSHOT`). The dependency baseline is the released IoTDB `v2.0.11` tag, not unreleased `master` snapshots.

JDK 17 is the minimum supported version; CI also covers JDK 21. External engines must support the chosen JDK independently. In particular, the legacy Spark 2.4/Scala 2.11 modules still require a runtime migration before deployment on JDK 17.

## Building from Source

To build the project from source, follow these steps:
Expand All @@ -85,7 +89,7 @@ To build the project from source, follow these steps:
2. Build the project with Maven:

```bash
# Build the entire project (includes distributions,iotdb-collector,metric-scrape,mybatis-generator)
# Build the entire project (includes distributions, iotdb-collector, metric-scrape, mybatis-generator, mybatis-support)
mvn clean package -DskipTests

# Or build all
Expand All @@ -107,6 +111,12 @@ IoTDB-Extras uses Maven profiles to configure different build options. You can c
mvn clean package -Pwith-springboot -DskipTests
```

The default starter build uses Spring Boot 3.5.1. Validate the same starter against Spring Boot 4.1.1 with:

```bash
mvn clean test -Pwith-springboot,spring-boot4 -pl iotdb-spring-boot-starter -am
```

- **with-examples**: Build example applications(Recommended for use in conjunction with Connector Profiles)

```bash
Expand All @@ -133,6 +143,12 @@ IoTDB-Extras uses Maven profiles to configure different build options. You can c
mvn clean package -Pwith-flink -DskipTests
```

- **with-mybatis**: Package the MyBatis generator plugin and runtime support as a distribution zip

```bash
mvn clean package -Pwith-mybatis -DskipTests
```

- **with-grafana**: Build Grafana connectors and plugins

```bash
Expand Down Expand Up @@ -268,8 +284,9 @@ This repository includes a variety of examples demonstrating how to use IoTDB wi

- **Introduction**: Shows how to use iotdb-spring-boot-starter
- **Version**:
- IoTDB: 2.0.3
- iotdb-spring-boot-starter: 2.0.3
- IoTDB: 2.0.11
- iotdb-spring-boot-starter: 2.0.4-SNAPSHOT
- Starter build line: Spring Boot 3.5.1 by default; Spring Boot 4.1.1 is CI-validated
- **Setup**:
1. Install IoTDB
2. Create necessary database and tables
Expand All @@ -294,8 +311,8 @@ This repository includes a variety of examples demonstrating how to use IoTDB wi

- **Introduction**: Shows how to use IoTDB-Mybatis-Generator
- **Version**:
- IoTDB: 2.0.2
- mybatis-generator-plugin: 1.3.2
- IoTDB: 2.0.11
- mybatis-generator-plugin: 2.0.4-SNAPSHOT
- **Setup**:
1. Install and start IoTDB
2. Create necessary database and tables
Expand All @@ -306,6 +323,8 @@ For detailed usage instructions, please refer to the README files in the specifi
- [Flink Examples](/examples/flink/README.md)
- [Spark Table Examples](/examples/spark-table/README.md)
- [MyBatis Generator Examples](/examples/mybatis-generator/README.md)
- [MyBatis Runtime Support (query and type adapters)](/mybatis-support/README.md)
- [MyBatis-Plus / Spring Boot 3 and 4 Example](/examples/mybatisplus-generator/README.md)
- [IoTDB Spring Boot Starter Examples](/examples/iotdb-spring-boot-start/README.md)
- [Kafka Examples](/examples/kafka/readme.md)

Expand Down
1 change: 0 additions & 1 deletion connectors/flink-iotdb-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<artifactId>flink-iotdb-connector</artifactId>
<name>IoTDB: Connector: Apache Flink</name>
<properties>
<compile.version>1.8</compile.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static void setGlobalTSFileConfig(TSFileConfig config) {
globalConfig.setDfsNameServices(config.getDfsNameServices());
globalConfig.setDftSatisfyRate(config.getDftSatisfyRate());
globalConfig.setEndian(config.getEndian());
globalConfig.setEncryptSalt(config.getEncryptSalt());
globalConfig.setFloatPrecision(config.getFloatPrecision());
globalConfig.setFreqType(config.getFreqType());
globalConfig.setGroupSizeInByte(config.getGroupSizeInByte());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ public void testTSFileConfigUtilCompleteness() {
"setDoubleCompression",
"setInt32Compression",
"setFloatCompression",
"setEncryptKeyFromToken"
"setEncryptKeyFromToken",
"setEncryptSalt"
};
Set<String> addedSetters = new HashSet<>();
Collections.addAll(addedSetters, setters);
Expand Down
16 changes: 16 additions & 0 deletions connectors/grafana-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
<start-class>org.apache.iotdb.web.grafana.TsfileWebDemoApplication</start-class>
</properties>
<dependencies>
<!-- JDBC is loaded by class name, so it must be packaged explicitly. -->
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-jdbc</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tsfile</groupId>
<artifactId>tsfile</artifactId>
Expand Down Expand Up @@ -209,6 +215,16 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<usedDependencies>
<!-- The JDBC driver is loaded via the configured class name. -->
<usedDependency>org.apache.iotdb:iotdb-jdbc</usedDependency>
</usedDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion connectors/grafana-plugin/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
# datasource in ./provisioning. The REST port serves the tree-model query
# modes; 6667 is the native Thrift port the table-model mode uses.
iotdb:
image: apache/iotdb:2.0.8-standalone
image: apache/iotdb:2.0.11-standalone
container_name: iotdb
environment:
- dn_rpc_address=0.0.0.0
Expand Down
1 change: 0 additions & 1 deletion connectors/hive-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<artifactId>hive-connector</artifactId>
<name>IoTDB: Connector: Apache Hive</name>
<properties>
<compile.version>1.8</compile.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private ObjectInspector createObjectInspectorWorker(TypeInfo ti) throws TsFileSe
PrimitiveTypeInfo pti = (PrimitiveTypeInfo) ti;
result = PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(pti);
break;
// these types is not supported in TsFile
// these types is not supported in TsFile
case LIST:
case MAP:
case STRUCT:
Expand Down
4 changes: 2 additions & 2 deletions connectors/spark-iotdb-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<module>scala_2.12</module>
</modules>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions connectors/spark-iotdb-table-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
<module>iotdb-table-connector-3.3</module>
</modules>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spark.version>3.5.0</spark.version>
</properties>
Expand Down
Loading
Loading