CritasWang opened a new pull request, #132:
URL: https://github.com/apache/iotdb-extras/pull/132
## Description
Align the Java integrations with the released IoTDB **2.0.11** baseline
(TsFile 2.4.0, Thrift 0.23.0) and move the reactor to **JDK 17**. Version
properties in the root pom follow the `iotdb-parent:2.0.11` values;
`iotdb-jdbc`, `iotdb-subscription` and `isession` are now managed centrally.
### Breaking changes
- Every Java module requires JDK 17. CI covers JDK 17 and 21; Jenkins builds
with JDK 17. The `.java-9-and-above` / `.java-11-below` / `.java-16` profiles
are gone.
- MyBatis: TIME/TIMESTAMP columns map to `Long` (raw server-precision
ticks), FLOAT to `Float`, DATE to `LocalDate`, BLOB to `byte[]`. Regenerate
mapper interfaces and XML together; `batchInsert` is now a bounded default
method over an internal `batchInsertRows` statement.
- MyBatis-Plus example: `IoTDBTableMapper` exposes only operations the IoTDB
table model supports (insert, selectList, selectByKey, deleteByKey,
upsertFields, updateAttributes) through a restricted `ISqlInjector`.
- Spring Boot starter: `fetch-size` defaults to the client's 5000 (was
1024); `connection-timeout-in-ms` defaults to 0 instead of failing startup when
unset; `sql-dialect` is deprecated and both pool types are always exposed.
### Spring Boot starter
`IoTDBSessionPool` becomes an `@AutoConfiguration` with
`@ConditionalOnMissingBean` pool beans that are closed with the context. The
compression flags follow the renamed 2.0.11 builder methods
(`enableThriftRpcCompaction` for the tree pool, `enableThriftCompression` for
the table pool). Defaults are documented in
`additional-spring-configuration-metadata.json` and covered by an
`ApplicationContextRunner` test. The same starter is validated against Spring
Boot 4.1.1 / Spring 7.0.9 through the `spring-boot4` profile.
### MyBatis
New `mybatis-support` module with runtime adapters: `IoTDBQueryInterceptor`
routes prepared queries through a single `executeQuery()` because the 2.0.11
driver's `execute()` returns `true` without populating `getResultSet()`;
`IoTDBLocalDateTypeHandler` and `IoTDBBlobTypeHandler` use the driver paths
that preserve NULL dates and arbitrary bytes. The generator plugin gains
`IoTDBKeyPlugin` (nullable TAG components become `IS NULL` predicates; UPDATE
statements are dropped with a warning because IoTDB UPDATE rejects `time` in
the predicate and FIELD columns in SET) and a bounded, validating
`BatchInsertPlugin`. A `with-mybatis` distribution profile ships the runtime
jar next to the generator plugin.
### Collector
`IoTDBPushSource` consumes record-format subscription messages through the
2.0.11 `getRecordTabletIterator()` API, validates the topic format and
subscribes on the calling thread so that a task that cannot consume fails
creation instead of staying registered while silently idle.
`PushSourceTask`/`PullSourceTask` propagate start failures like `SinkTask`
already did.
### ThingsBoard, connectors, CI
The ThingsBoard module follows the reactor versions and its container ITs
default to `apache/iotdb:2.0.11-standalone`; each IT now drops the databases it
created so the shared container does not run out of region memory.
`TSFileConfigUtil` covers the new `setEncryptSalt` setter. The CI compile-check
matrix is JDK 17/21, adds the ThingsBoard and Grafana connector profiles, a
Spring Boot 4 job, and a `mybatis-integration` job that runs the generator and
MyBatis-Plus mappers against a real IoTDB 2.0.11 service container (bound to
all interfaces and awaited with a real client session, not a TCP probe).
### Validation performed locally
- `mvn clean verify
-Pwith-springboot,with-all-connectors,with-examples,with-thingsboard,with-grafana-connector,with-mybatis`
on JDK 17 and JDK 21: all 40 modules pass (272 tests on JDK 21).
- Both `mybatis-integration` matrix entries (`iotdb-mybatis-it` and
`iotdb-mybatis-it,spring-boot4`) against an `apache/iotdb:2.0.11-standalone`
container started like the CI service, ms precision.
- Starter tests on Spring Boot 3.5.1 and 4.1.1; MyBatis-Plus example unit
and live ITs on both Boot lines.
- ThingsBoard `-Piotdb-table-it` Testcontainers suite: 58/58.
- JDBC probes on 2.0.11 confirming the behaviors the adapters rely on
(prepared `execute()` leaves `getResultSet()` null, update counts are -1,
`TTL=INF` unquoted is rejected, grouped MAX of non-positive floats is fixed,
SUM over INT64 returns DOUBLE).
### Known limitations
- On servers configured with us/ns time precision, a DELETE with a time
predicate can report success without deleting the row on IoTDB 2.0.11; the ms
suites pass and the READMEs document this server-side issue. The tests were not
weakened.
- The collector source's steady-state consumption path was not exercised
against a live broker: the Apache 2.0.11 image has subscription disabled at
compile time. Its failure path (missing topic, tsfile topic, subscription
disabled) is what was verified.
- The Spark 2.4 / Scala 2.11 modules compile but still need a runtime
migration before deployment on JDK 17.
<hr>
This PR has:
- [x] been self-reviewed.
- [x] added documentation for new or modified features or behaviors.
- [ ] added Javadocs for most classes and all non-trivial methods.
- [x] added or updated version, __license__, or notice information
- [x] added comments explaining the "why" and the intent of the code
wherever would not be obvious
for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold
for code coverage.
- [x] added integration tests.
- [ ] been tested in a test IoTDB cluster (tested against a standalone IoTDB
2.0.11 container).
<hr>
##### Key changed/added classes (or packages if there are too many classes)
in this PR
- `pom.xml` (version baseline, JDK 17 enforcer),
`.github/workflows/compile-check.yml`, `Jenkinsfile`
- `iotdb-spring-boot-starter`: `IoTDBSessionPool`, `IoTDBSessionProperties`,
`IoTDBSessionPoolTest`
- `mybatis-support` (new): `IoTDBQueryInterceptor`,
`IoTDBLocalDateTypeHandler`, `IoTDBBlobTypeHandler`
- `mybatis-generator`: `BatchInsertPlugin`, `IoTDBKeyPlugin`, `LombokPlugin`
- `examples/mybatis-generator`, `examples/mybatisplus-generator`
(`CodeGenerator`, `IoTDBTableMapper`, `IoTDBMybatisConfiguration`, Velocity
templates)
- `iotdb-collector`: `IoTDBPushSource`, `PipeRawTabletInsertionEvent`,
`PushSourceTask`, `PullSourceTask`
- `iotdb-thingsboard-table`: `IoTDBTableConfiguration`,
`IoTDBTableTimeseriesDao`, container ITs
- `distributions`: `with-mybatis` profile and assembly
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]