diff --git a/.github/workflows/compile-check.yml b/.github/workflows/compile-check.yml
index 78278280..99b81e84 100644
--- a/.github/workflows/compile-check.yml
+++ b/.github/workflows/compile-check.yml
@@ -34,7 +34,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- java: [8, 11, 17]
+ java: [8, 11, 17, 21]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
@@ -47,4 +47,8 @@ jobs:
- name: Compiler Test
shell: bash
run: |
- mvn clean verify -P with-integration-tests -ntp
+ if [ "${{ matrix.java }}" -ge 17 ]; then
+ mvn clean verify -P with-springboot -ntp
+ else
+ mvn clean verify -ntp
+ fi
diff --git a/examples/iotdb-spring-boot-start/pom.xml b/examples/iotdb-spring-boot-start/pom.xml
index 919f52c1..8090af8a 100644
--- a/examples/iotdb-spring-boot-start/pom.xml
+++ b/examples/iotdb-spring-boot-start/pom.xml
@@ -31,10 +31,12 @@
org.apache.iotdb
iotdb-spring-boot-start-example
2.0.2-SNAPHOT
- iotdb-spring-boot-start
+ IoTDB: Example: SpringBoot Starter
iotdb-spring-boot-start
17
+ 3.4.5
+ 6.2.6
diff --git a/examples/iotdb-spring-boot-start/src/main/resources/application.properties b/examples/iotdb-spring-boot-start/src/main/resources/application.properties
index 98953f12..19e61953 100644
--- a/examples/iotdb-spring-boot-start/src/main/resources/application.properties
+++ b/examples/iotdb-spring-boot-start/src/main/resources/application.properties
@@ -18,7 +18,7 @@
spring.application.name=iotdb-spring-boot-start
-iotdb.session.url=172.20.31.56:6668
+iotdb.session.url=127.0.0.1:6667
iotdb.session.password=root
iotdb.session.username=root
iotdb.session.database=wind
diff --git a/examples/iotdb-spring-boot-start/src/test/java/org/apache/iotdb/iotdbspringbootstartexample/SpringBootIoTDBApplicationTests.java b/examples/iotdb-spring-boot-start/src/test/java/org/apache/iotdb/iotdbspringbootstartexample/SpringBootIoTDBApplicationTests.java
index 0e989594..d5ec0d99 100644
--- a/examples/iotdb-spring-boot-start/src/test/java/org/apache/iotdb/iotdbspringbootstartexample/SpringBootIoTDBApplicationTests.java
+++ b/examples/iotdb-spring-boot-start/src/test/java/org/apache/iotdb/iotdbspringbootstartexample/SpringBootIoTDBApplicationTests.java
@@ -30,7 +30,7 @@ public class SpringBootIoTDBApplicationTests {
@Autowired
private IoTDBService iotdbService;
- @Test
+ // @Test
void contextLoads() throws IoTDBConnectionException, StatementExecutionException {
iotdbService.querySessionPool();
iotdbService.queryTableSessionPool();
diff --git a/examples/mybatis-generator/pom.xml b/examples/mybatis-generator/pom.xml
index 83e2c72b..c7d73e3f 100644
--- a/examples/mybatis-generator/pom.xml
+++ b/examples/mybatis-generator/pom.xml
@@ -28,12 +28,8 @@
../../pom.xml
mybatis-generator-example
+ IoTDB: Example: Mybatis Generator
2.0.2-SNAPHOT
-
- 21
- 21
- UTF-8
-
@@ -44,7 +40,7 @@
org.apache.iotdb
mybatis-generator-plugin
- 1.3.2
+ 2.0.2-SNAPSHOT
diff --git a/examples/mybatisplus-generator/pom.xml b/examples/mybatisplus-generator/pom.xml
index a24d9470..729e2de8 100644
--- a/examples/mybatisplus-generator/pom.xml
+++ b/examples/mybatisplus-generator/pom.xml
@@ -29,14 +29,22 @@
org.apache.iotdb
mybatisplus-generator-example
+ IoTDB: Example: Mybatis Plus Generator
2.0.2-SNAPHOT
3.5.10
- 21
- 21
+ 17
+ 17
UTF-8
+ 3.4.5
+ 6.2.6
+
+ org.mybatis
+ mybatis
+ 3.5.19
+
com.baomidou
mybatis-plus-spring-boot3-starter
@@ -50,32 +58,27 @@
org.apache.velocity
velocity-engine-core
- 2.0
+ 2.4.1
org.apache.iotdb
iotdb-jdbc
- 2.0.1-beta
+ ${iotdb.version}
org.springframework.boot
spring-boot-starter
- 3.4.3
+ ${spring-boot.version}
org.springframework.boot
spring-boot-starter-web
- 3.4.3
-
-
- io.springfox
- springfox-swagger2
- 3.0.0
+ ${spring-boot.version}
- io.springfox
- springfox-swagger-ui
- 3.0.0
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ 2.8.6
org.projectlombok
@@ -83,4 +86,27 @@
1.18.36
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+
+ org.apache.iotdb:isession
+
+
+
+ com.baomidou:mybatis-plus-spring-boot3-starter
+ org.apache.velocity:velocity-engine-core
+ org.springframework.boot:spring-boot-starter
+ org.springframework.boot:spring-boot-starter-web
+ org.springdoc:springdoc-openapi-starter-webmvc-ui
+ org.projectlombok:lombok
+
+
+
+
+
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/Main.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/Main.java
index b8e19af9..bb98fbdb 100644
--- a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/Main.java
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/Main.java
@@ -19,62 +19,75 @@
package org.apache.iotdb;
+import org.apache.iotdb.jdbc.IoTDBDataSource;
+
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
-import org.apache.iotdb.jdbc.IoTDBDataSource;
import java.sql.Types;
import java.util.Collections;
-
public class Main {
- public static void main(String[] args) {
- IoTDBDataSource dataSource = new IoTDBDataSource();
- dataSource.setUrl("jdbc:iotdb://127.0.0.1:6667/test?sql_dialect=table");
- dataSource.setUser("root");
- dataSource.setPassword("root");
- FastAutoGenerator generator = FastAutoGenerator.create(new DataSourceConfig.Builder(dataSource).driverClassName("org.apache.iotdb.jdbc.IoTDBDriver"));
- generator
- .globalConfig(builder -> {
- builder.author("IoTDB")
- .enableSwagger()
- .dateType(DateType.ONLY_DATE)
- .outputDir("/apache/iotdb-extras/examples/mybatisplus-generator/src/main/java/");
- })
- .packageConfig(builder -> {
- builder.parent("org.apache.iotdb")
- .mapper("mapper")
- .pathInfo(Collections.singletonMap(OutputFile.xml, "/apache/iotdb-extras/examples/mybatisplus-generator/src/main/java/"));
- })
- .dataSourceConfig(builder -> {
- builder.typeConvertHandler((globalConfig, typeRegistry, metaInfo) -> {
- int typeCode = metaInfo.getJdbcType().TYPE_CODE;
- switch (typeCode) {
- case Types.FLOAT:
- return DbColumnType.FLOAT;
- default:
- return typeRegistry.getColumnType(metaInfo);
- }
- });
- })
- .strategyConfig(builder -> {
- builder.addInclude("mix");
- builder.entityBuilder()
- .enableLombok()
- .addIgnoreColumns("create_time")
- .enableFileOverride();
- builder.serviceBuilder()
- .formatServiceFileName("%sService")
- .formatServiceImplFileName("%sServiceImpl")
- .convertServiceFileName((entityName -> entityName + "Service"))
- .enableFileOverride();
- builder.controllerBuilder()
- .enableRestStyle()
- .enableFileOverride();
- })
- .execute();
- }
+ public static void main(String[] args) {
+ IoTDBDataSource dataSource = new IoTDBDataSource();
+ dataSource.setUrl("jdbc:iotdb://127.0.0.1:6667/test?sql_dialect=table");
+ dataSource.setUser("root");
+ dataSource.setPassword("root");
+ FastAutoGenerator generator =
+ FastAutoGenerator.create(
+ new DataSourceConfig.Builder(dataSource)
+ .driverClassName("org.apache.iotdb.jdbc.IoTDBDriver"));
+ generator
+ .globalConfig(
+ builder -> {
+ builder
+ .author("IoTDB")
+ .enableSwagger()
+ .dateType(DateType.ONLY_DATE)
+ .outputDir("/apache/iotdb-extras/examples/mybatisplus-generator/src/main/java/");
+ })
+ .packageConfig(
+ builder -> {
+ builder
+ .parent("org.apache.iotdb")
+ .mapper("mapper")
+ .pathInfo(
+ Collections.singletonMap(
+ OutputFile.xml,
+ "/apache/iotdb-extras/examples/mybatisplus-generator/src/main/java/"));
+ })
+ .dataSourceConfig(
+ builder -> {
+ builder.typeConvertHandler(
+ (globalConfig, typeRegistry, metaInfo) -> {
+ int typeCode = metaInfo.getJdbcType().TYPE_CODE;
+ switch (typeCode) {
+ case Types.FLOAT:
+ return DbColumnType.FLOAT;
+ default:
+ return typeRegistry.getColumnType(metaInfo);
+ }
+ });
+ })
+ .strategyConfig(
+ builder -> {
+ builder.addInclude("mix");
+ builder
+ .entityBuilder()
+ .enableLombok()
+ .addIgnoreColumns("create_time")
+ .enableFileOverride();
+ builder
+ .serviceBuilder()
+ .formatServiceFileName("%sService")
+ .formatServiceImplFileName("%sServiceImpl")
+ .convertServiceFileName((entityName -> entityName + "Service"))
+ .enableFileOverride();
+ builder.controllerBuilder().enableRestStyle().enableFileOverride();
+ })
+ .execute();
+ }
}
diff --git a/examples/pom.xml b/examples/pom.xml
index f743e7bf..3c99c7f2 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -38,7 +38,17 @@
rabbitmq
rocketmq
spark-table
+ mybatis-generator
+
+
+ with-springboot
+
+ iotdb-spring-boot-start
+ mybatisplus-generator
+
+
+
diff --git a/iotdb-spring-boot-starter/pom.xml b/iotdb-spring-boot-starter/pom.xml
index 03e831af..cd2ad444 100644
--- a/iotdb-spring-boot-starter/pom.xml
+++ b/iotdb-spring-boot-starter/pom.xml
@@ -22,42 +22,86 @@
4.0.0
- org.springframework.boot
- spring-boot-starter-parent
- 3.4.5
-
-
+ org.apache.iotdb
+ iotdb-extras-parent
+ 2.0.2-SNAPSHOT
org.apache.iotdb
iotdb-spring-boot-starter
+ IoTDB Extras: SpringBoot Starter
2.0.2-SNAPSHOT
17
17
UTF-8
- 3.4.5
- 2.0.2
+ 3.4.5
+ 6.2.6
+
+
+
+ org.springframework.boot
+ spring-boot-dependencies
+ ${spring-boot.version}
+ pom
+ import
+
+
+
+
+ org.apache.iotdb
+ isession
+ ${iotdb.version}
+
org.apache.iotdb
iotdb-session
${iotdb.version}
+
+ org.springframework.boot
+ spring-boot
+ ${spring-boot.version}
+
org.springframework.boot
spring-boot-starter
- ${spring-boot3.version}
+ ${spring-boot.version}
org.springframework.boot
spring-boot-autoconfigure
- ${spring-boot3.version}
+ ${spring-boot.version}
org.springframework.boot
spring-boot-configuration-processor
- ${spring-boot3.version}
+ ${spring-boot.version}
+
+
+ org.springframework
+ spring-context
+ ${spring.version}
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+
+ org.apache.iotdb:isession
+
+
+
+ org.springframework.boot:spring-boot-starter
+ org.springframework.boot:spring-boot-configuration-processor
+
+
+
+
+
diff --git a/iotdb-spring-boot-starter/src/main/java/org/apache/iotdb/config/IoTDBSessionProperties.java b/iotdb-spring-boot-starter/src/main/java/org/apache/iotdb/config/IoTDBSessionProperties.java
index b61ee8d0..25c22120 100644
--- a/iotdb-spring-boot-starter/src/main/java/org/apache/iotdb/config/IoTDBSessionProperties.java
+++ b/iotdb-spring-boot-starter/src/main/java/org/apache/iotdb/config/IoTDBSessionProperties.java
@@ -21,154 +21,154 @@
@ConfigurationProperties(prefix = "iotdb.session")
public class IoTDBSessionProperties {
- private String url;
- private String username;
- private String password;
- private String database;
- private String sql_dialect = "table";
- private Integer max_size = 5;
- private Integer fetch_size = 1024;
- private long query_timeout_in_ms = 60000L;
- private boolean enable_auto_fetch = true;
- private boolean use_ssl = false;
- private int max_retry_count = 60;
- private long wait_to_get_session_timeout_in_msit = 60000L;
- private boolean enable_compression = false;
- private long retry_interval_in_ms = 500L;
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getDatabase() {
- return database;
- }
-
- public void setDatabase(String database) {
- this.database = database;
- }
-
- public String getSql_dialect() {
- return sql_dialect;
- }
-
- public void setSql_dialect(String sql_dialect) {
- this.sql_dialect = sql_dialect;
- }
-
- public Integer getMax_size() {
- return max_size;
- }
-
- public void setMax_size(Integer max_size) {
- this.max_size = max_size;
- }
-
- public Integer getFetch_size() {
- return fetch_size;
- }
-
- public void setFetch_size(Integer fetch_size) {
- this.fetch_size = fetch_size;
- }
-
- public Long getQuery_timeout_in_ms() {
- return query_timeout_in_ms;
- }
-
- public void setQuery_timeout_in_ms(Long query_timeout_in_ms) {
- this.query_timeout_in_ms = query_timeout_in_ms;
- }
-
- public Boolean getEnable_auto_fetch() {
- return enable_auto_fetch;
- }
-
- public void setEnable_auto_fetch(Boolean enable_auto_fetch) {
- this.enable_auto_fetch = enable_auto_fetch;
- }
-
- public Boolean getUse_ssl() {
- return use_ssl;
- }
-
- public void setUse_ssl(Boolean use_ssl) {
- this.use_ssl = use_ssl;
- }
-
- public Integer getMax_retry_count() {
- return max_retry_count;
- }
-
- public void setMax_retry_count(Integer max_retry_count) {
- this.max_retry_count = max_retry_count;
- }
-
- public void setQuery_timeout_in_ms(long query_timeout_in_ms) {
- this.query_timeout_in_ms = query_timeout_in_ms;
- }
-
- public boolean isEnable_auto_fetch() {
- return enable_auto_fetch;
- }
-
- public void setEnable_auto_fetch(boolean enable_auto_fetch) {
- this.enable_auto_fetch = enable_auto_fetch;
- }
+ private String url;
+ private String username;
+ private String password;
+ private String database;
+ private String sql_dialect = "table";
+ private Integer max_size = 5;
+ private Integer fetch_size = 1024;
+ private long query_timeout_in_ms = 60000L;
+ private boolean enable_auto_fetch = true;
+ private boolean use_ssl = false;
+ private int max_retry_count = 60;
+ private long wait_to_get_session_timeout_in_msit = 60000L;
+ private boolean enable_compression = false;
+ private long retry_interval_in_ms = 500L;
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getDatabase() {
+ return database;
+ }
+
+ public void setDatabase(String database) {
+ this.database = database;
+ }
+
+ public String getSql_dialect() {
+ return sql_dialect;
+ }
+
+ public void setSql_dialect(String sql_dialect) {
+ this.sql_dialect = sql_dialect;
+ }
+
+ public Integer getMax_size() {
+ return max_size;
+ }
+
+ public void setMax_size(Integer max_size) {
+ this.max_size = max_size;
+ }
+
+ public Integer getFetch_size() {
+ return fetch_size;
+ }
+
+ public void setFetch_size(Integer fetch_size) {
+ this.fetch_size = fetch_size;
+ }
+
+ public Long getQuery_timeout_in_ms() {
+ return query_timeout_in_ms;
+ }
+
+ public void setQuery_timeout_in_ms(Long query_timeout_in_ms) {
+ this.query_timeout_in_ms = query_timeout_in_ms;
+ }
+
+ public Boolean getEnable_auto_fetch() {
+ return enable_auto_fetch;
+ }
+
+ public void setEnable_auto_fetch(Boolean enable_auto_fetch) {
+ this.enable_auto_fetch = enable_auto_fetch;
+ }
+
+ public Boolean getUse_ssl() {
+ return use_ssl;
+ }
+
+ public void setUse_ssl(Boolean use_ssl) {
+ this.use_ssl = use_ssl;
+ }
+
+ public Integer getMax_retry_count() {
+ return max_retry_count;
+ }
+
+ public void setMax_retry_count(Integer max_retry_count) {
+ this.max_retry_count = max_retry_count;
+ }
+
+ public void setQuery_timeout_in_ms(long query_timeout_in_ms) {
+ this.query_timeout_in_ms = query_timeout_in_ms;
+ }
+
+ public boolean isEnable_auto_fetch() {
+ return enable_auto_fetch;
+ }
+
+ public void setEnable_auto_fetch(boolean enable_auto_fetch) {
+ this.enable_auto_fetch = enable_auto_fetch;
+ }
- public boolean isUse_ssl() {
- return use_ssl;
- }
+ public boolean isUse_ssl() {
+ return use_ssl;
+ }
- public void setUse_ssl(boolean use_ssl) {
- this.use_ssl = use_ssl;
- }
+ public void setUse_ssl(boolean use_ssl) {
+ this.use_ssl = use_ssl;
+ }
- public void setMax_retry_count(int max_retry_count) {
- this.max_retry_count = max_retry_count;
- }
+ public void setMax_retry_count(int max_retry_count) {
+ this.max_retry_count = max_retry_count;
+ }
- public long getWait_to_get_session_timeout_in_msit() {
- return wait_to_get_session_timeout_in_msit;
- }
+ public long getWait_to_get_session_timeout_in_msit() {
+ return wait_to_get_session_timeout_in_msit;
+ }
- public void setWait_to_get_session_timeout_in_msit(long wait_to_get_session_timeout_in_msit) {
- this.wait_to_get_session_timeout_in_msit = wait_to_get_session_timeout_in_msit;
- }
+ public void setWait_to_get_session_timeout_in_msit(long wait_to_get_session_timeout_in_msit) {
+ this.wait_to_get_session_timeout_in_msit = wait_to_get_session_timeout_in_msit;
+ }
- public boolean isEnable_compression() {
- return enable_compression;
- }
+ public boolean isEnable_compression() {
+ return enable_compression;
+ }
- public void setEnable_compression(boolean enable_compression) {
- this.enable_compression = enable_compression;
- }
+ public void setEnable_compression(boolean enable_compression) {
+ this.enable_compression = enable_compression;
+ }
- public long getRetry_interval_in_ms() {
- return retry_interval_in_ms;
- }
+ public long getRetry_interval_in_ms() {
+ return retry_interval_in_ms;
+ }
- public void setRetry_interval_in_ms(long retry_interval_in_ms) {
- this.retry_interval_in_ms = retry_interval_in_ms;
- }
-}
\ No newline at end of file
+ public void setRetry_interval_in_ms(long retry_interval_in_ms) {
+ this.retry_interval_in_ms = retry_interval_in_ms;
+ }
+}
diff --git a/iotdb-spring-boot-starter/src/main/java/org/apache/iotdb/session/IoTDBSessionPool.java b/iotdb-spring-boot-starter/src/main/java/org/apache/iotdb/session/IoTDBSessionPool.java
index 8914cdd8..5267c924 100644
--- a/iotdb-spring-boot-starter/src/main/java/org/apache/iotdb/session/IoTDBSessionPool.java
+++ b/iotdb-spring-boot-starter/src/main/java/org/apache/iotdb/session/IoTDBSessionPool.java
@@ -22,6 +22,7 @@
import org.apache.iotdb.isession.pool.ITableSessionPool;
import org.apache.iotdb.session.pool.SessionPool;
import org.apache.iotdb.session.pool.TableSessionPoolBuilder;
+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
@@ -34,62 +35,64 @@
@EnableConfigurationProperties(IoTDBSessionProperties.class)
public class IoTDBSessionPool {
- private final IoTDBSessionProperties properties;
- private ITableSessionPool tableSessionPool;
- private ISessionPool treeSessionPool;
+ private final IoTDBSessionProperties properties;
+ private ITableSessionPool tableSessionPool;
+ private ISessionPool treeSessionPool;
- public IoTDBSessionPool(IoTDBSessionProperties properties) {
- this.properties = properties;
- }
+ public IoTDBSessionPool(IoTDBSessionProperties properties) {
+ this.properties = properties;
+ }
- @Bean
- public ITableSessionPool tableSessionPool() {
- if(tableSessionPool == null) {
- synchronized (IoTDBSessionPool.class) {
- if(tableSessionPool == null) {
- tableSessionPool = new TableSessionPoolBuilder().
- nodeUrls(Arrays.asList(properties.getUrl().split(";"))).
- user(properties.getUsername()).
- password(properties.getPassword()).
- database(properties.getDatabase()).
- maxSize(properties.getMax_size()).
- fetchSize(properties.getFetch_size()).
- enableAutoFetch(properties.getEnable_auto_fetch()).
- useSSL(properties.getUse_ssl()).
- queryTimeoutInMs(properties.getQuery_timeout_in_ms()).
- maxRetryCount(properties.getMax_retry_count()).
- waitToGetSessionTimeoutInMs(properties.getQuery_timeout_in_ms()).
- enableCompression(properties.isEnable_compression()).
- retryIntervalInMs(properties.getRetry_interval_in_ms()).
- build();
- }
- }
+ @Bean
+ public ITableSessionPool tableSessionPool() {
+ if (tableSessionPool == null) {
+ synchronized (IoTDBSessionPool.class) {
+ if (tableSessionPool == null) {
+ tableSessionPool =
+ new TableSessionPoolBuilder()
+ .nodeUrls(Arrays.asList(properties.getUrl().split(";")))
+ .user(properties.getUsername())
+ .password(properties.getPassword())
+ .database(properties.getDatabase())
+ .maxSize(properties.getMax_size())
+ .fetchSize(properties.getFetch_size())
+ .enableAutoFetch(properties.getEnable_auto_fetch())
+ .useSSL(properties.getUse_ssl())
+ .queryTimeoutInMs(properties.getQuery_timeout_in_ms())
+ .maxRetryCount(properties.getMax_retry_count())
+ .waitToGetSessionTimeoutInMs(properties.getQuery_timeout_in_ms())
+ .enableCompression(properties.isEnable_compression())
+ .retryIntervalInMs(properties.getRetry_interval_in_ms())
+ .build();
}
- return tableSessionPool;
+ }
}
+ return tableSessionPool;
+ }
- @Bean
- public ISessionPool treeSessionPool() {
- if(treeSessionPool == null) {
- synchronized (IoTDBSessionPool.class) {
- if(treeSessionPool == null) {
- treeSessionPool = new SessionPool.Builder().
- nodeUrls(Arrays.asList(properties.getUrl().split(";"))).
- user(properties.getUsername()).
- password(properties.getPassword()).
- maxSize(properties.getMax_size()).
- fetchSize(properties.getFetch_size()).
- enableAutoFetch(properties.getEnable_auto_fetch()).
- useSSL(properties.getUse_ssl()).
- queryTimeoutInMs(properties.getQuery_timeout_in_ms()).
- maxRetryCount(properties.getMax_retry_count()).
- waitToGetSessionTimeoutInMs(properties.getQuery_timeout_in_ms()).
- enableCompression(properties.isEnable_compression()).
- retryIntervalInMs(properties.getRetry_interval_in_ms()).
- build();
- }
- }
+ @Bean
+ public ISessionPool treeSessionPool() {
+ if (treeSessionPool == null) {
+ synchronized (IoTDBSessionPool.class) {
+ if (treeSessionPool == null) {
+ treeSessionPool =
+ new SessionPool.Builder()
+ .nodeUrls(Arrays.asList(properties.getUrl().split(";")))
+ .user(properties.getUsername())
+ .password(properties.getPassword())
+ .maxSize(properties.getMax_size())
+ .fetchSize(properties.getFetch_size())
+ .enableAutoFetch(properties.getEnable_auto_fetch())
+ .useSSL(properties.getUse_ssl())
+ .queryTimeoutInMs(properties.getQuery_timeout_in_ms())
+ .maxRetryCount(properties.getMax_retry_count())
+ .waitToGetSessionTimeoutInMs(properties.getQuery_timeout_in_ms())
+ .enableCompression(properties.isEnable_compression())
+ .retryIntervalInMs(properties.getRetry_interval_in_ms())
+ .build();
}
- return treeSessionPool;
+ }
}
+ return treeSessionPool;
+ }
}
diff --git a/mybatis-generator/pom.xml b/mybatis-generator/pom.xml
index 43ec0e44..803d02cb 100644
--- a/mybatis-generator/pom.xml
+++ b/mybatis-generator/pom.xml
@@ -8,6 +8,7 @@
org.apache.iotdb
mybatis-generator-plugin
+ IoTDB Extras: Mybatis Generator Plugin
2.0.2-SNAPSHOT
jar
diff --git a/pom.xml b/pom.xml
index ef373b34..34890370 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2069,6 +2069,12 @@
true
+
+ with-springboot
+
+ iotdb-spring-boot-starter
+
+
apache-release