This is an automated email from the ASF dual-hosted git repository.

gongchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git


The following commit(s) were added to refs/heads/master by this push:
     new 41de1b9b5 [refactor] split the WarehouseProperties class (#1830)
41de1b9b5 is described below

commit 41de1b9b5d440861e45e0f9f0b5ada2f9d980678
Author: xuziyang <[email protected]>
AuthorDate: Thu Apr 25 14:54:38 2024 +0800

    [refactor] split the WarehouseProperties class (#1830)
    
    Co-authored-by: tomsun28 <[email protected]>
---
 .../org/apache/hertzbeat/manager/ManagerTest.java  |   2 -
 .../config/WarehouseAutoConfiguration.java         |   2 -
 .../warehouse/config/WarehouseProperties.java      | 176 ---------------------
 .../KafkaProperties.java}                          |  19 ++-
 .../warehouse/config/store/StoreProperties.java    |  44 ++++++
 .../greptime/GreptimeProperties.java}              |  17 +-
 .../influxdb/InfluxdbProperties.java}              |  19 ++-
 .../config/store/iotdb/IotDbProperties.java        |  48 ++++++
 .../config/{ => store/iotdb}/IotDbVersion.java     |   2 +-
 .../jpa/JpaProperties.java}                        |  19 ++-
 .../memory/MemoryProperties.java}                  |  17 +-
 .../redis/RedisProperties.java}                    |  18 ++-
 .../config/store/tdengine/TdEngineProperties.java  |  38 +++++
 .../vm/VictoriaMetricsProperties.java}             |  17 +-
 .../store/HistoryGrepTimeDbDataStorage.java        |   8 +-
 .../store/HistoryInfluxdbDataStorage.java          |  11 +-
 .../warehouse/store/HistoryIotDbDataStorage.java   |  10 +-
 .../store/HistoryJpaDatabaseDataStorage.java       |   8 +-
 .../store/HistoryTdEngineDataStorage.java          |  12 +-
 .../store/HistoryVictoriaMetricsDataStorage.java   |  10 +-
 .../warehouse/store/RealTimeMemoryDataStorage.java |  10 +-
 .../warehouse/store/RealTimeRedisDataStorage.java  |  18 +--
 22 files changed, 244 insertions(+), 281 deletions(-)

diff --git 
a/manager/src/test/java/org/apache/hertzbeat/manager/ManagerTest.java 
b/manager/src/test/java/org/apache/hertzbeat/manager/ManagerTest.java
index f50761afe..47333b3c4 100644
--- a/manager/src/test/java/org/apache/hertzbeat/manager/ManagerTest.java
+++ b/manager/src/test/java/org/apache/hertzbeat/manager/ManagerTest.java
@@ -42,7 +42,6 @@ import 
org.apache.hertzbeat.common.queue.impl.InMemoryCommonDataQueue;
 import org.apache.hertzbeat.common.service.TencentSmsClient;
 import org.apache.hertzbeat.common.support.SpringContextHolder;
 import org.apache.hertzbeat.warehouse.WarehouseWorkerPool;
-import org.apache.hertzbeat.warehouse.config.WarehouseProperties;
 import org.apache.hertzbeat.warehouse.controller.MetricsDataController;
 import org.apache.hertzbeat.warehouse.store.HistoryIotDbDataStorage;
 import org.apache.hertzbeat.warehouse.store.HistoryTdEngineDataStorage;
@@ -102,7 +101,6 @@ class ManagerTest extends AbstractSpringIntegrationTest {
         assertNotNull(ctx.getBean(SpringContextHolder.class));
 
         // test warehouse module
-        assertNotNull(ctx.getBean(WarehouseProperties.class));
         assertNotNull(ctx.getBean(WarehouseWorkerPool.class));
 
         // default DataStorage is RealTimeMemoryDataStorage
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
index 184ec9ef7..23e3feb22 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
@@ -17,7 +17,6 @@
 
 package org.apache.hertzbeat.warehouse.config;
 
-import 
org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.ComponentScan;
 
 /**
@@ -25,6 +24,5 @@ import org.springframework.context.annotation.ComponentScan;
  * @version 2.1
  */
 @ComponentScan(basePackages = "org.apache.hertzbeat.warehouse")
-@EnableConfigurationProperties(WarehouseProperties.class)
 public class WarehouseAutoConfiguration {
 }
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseProperties.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseProperties.java
deleted file mode 100644
index 3dc69dfd8..000000000
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseProperties.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hertzbeat.warehouse.config;
-
-import java.time.ZoneId;
-import java.util.List;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.bind.DefaultValue;
-
-/**
- * Data warehouse configuration properties
- * @param entrance Data entry configuration properties
- * @param store  Datastore configuration properties
- */
-@ConfigurationProperties(prefix = "warehouse")
-public record WarehouseProperties (
-    EntranceProperties entrance,
-    StoreProperties store
-) {
-
-    /**
-     * Data entry configuration properties
-     * The entrance can be to obtain data from message middleware such as 
kafka rabbitmq rocketmq
-     */
-    public record EntranceProperties(
-        KafkaProperties kafka
-    ){
-        /**
-         * kafka configuration information
-         */
-        public record KafkaProperties(
-                @DefaultValue("true") boolean enabled,
-                @DefaultValue("127.0.0.1:9092") String servers,
-                String topic,
-                String groupId
-        ){}
-    }
-
-    /**
-     * Scheduling data export configuration properties
-     * @param jpa use mysql/h2 jpa store metrics history data
-     * @param memory Memory storage configuration information
-     * @param influxdb influxdb configuration information
-     * @param redis redis configuration information
-     * @param victoriaMetrics VictoriaMetrics Properties
-     * @param tdEngine TdEngine configuration information
-     * @param iotDb IoTDB configuration information
-     * @param greptime GrepTimeDB Config
-     */
-    public record StoreProperties(
-        JpaProperties jpa,
-        MemoryProperties memory,
-        InfluxdbProperties influxdb,
-        RedisProperties redis,
-        VictoriaMetricsProperties victoriaMetrics,
-        TdEngineProperties tdEngine,
-        IotDbProperties iotDb,
-        GreptimeProperties greptime
-    ){
-        /**
-         * Memory storage configuration information
-         * @param enabled Whether memory data storage is enabled
-         * @param initSize Memory storage map initialization size
-         */
-        public record MemoryProperties(
-                @DefaultValue("true") boolean enabled,
-                @DefaultValue("1024") Integer initSize
-        ){}
-
-        /**
-         * JPA configuration information
-         * @param enabled use mysql/h2 jpa store metrics history data
-         * @param expireTime save data expire time(ms)
-         * @param maxHistoryRecordNum The maximum number of history records 
retained
-         */
-        public record JpaProperties(
-                @DefaultValue("true") boolean enabled,
-                @DefaultValue("1h") String expireTime,
-                @DefaultValue("20000") Integer maxHistoryRecordNum
-        ) {}
-
-        /**
-         * Influxdb configuration information
-         */
-        public record InfluxdbProperties(
-                @DefaultValue("false") boolean enabled,
-                String serverUrl,
-                String username,
-                String password,
-                @DefaultValue("30d") String expireTime,
-                @DefaultValue("1") int replication) {}
-
-        /**
-         *
-         * @param enabled Whether the TdEngine data store is enabled
-         * @param url TdEngine connect url
-         * @param driverClassName tdengine driver, default restful driver
-         * @param username tdengine username
-         * @param password  tdengine password
-         * @param tableStrColumnDefineMaxLength auto create table's string 
column define max length : NCHAR(200)
-         */
-        public record TdEngineProperties(
-                @DefaultValue("false") boolean enabled,
-                @DefaultValue("jdbc:TAOS-RS://localhost:6041/demo") String url,
-                @DefaultValue("com.taosdata.jdbc.rs.RestfulDriver") String 
driverClassName,
-                String username,
-                String password,
-                @DefaultValue("200") int tableStrColumnDefineMaxLength) {}
-
-        /**
-         * Victoriametrics configuration information
-         */
-        public record VictoriaMetricsProperties(
-                @DefaultValue("false") boolean enabled,
-                @DefaultValue("http://localhost:8428";) String url,
-                String username,
-                String password) {}
-
-        /**
-         * Redis configuration information
-         */
-        public record RedisProperties(
-                @DefaultValue("false") boolean enabled,
-                @DefaultValue("127.0.0.1") String host,
-                @DefaultValue("6379") Integer port,
-                String password,
-                @DefaultValue("0") Integer db) {}
-
-        /**
-         * IotDB configuration information
-         * @param enabled Whether the iotDB data store is enabled
-         * @param host iotDB host
-         * @param expireTime save data expire time(ms),-1 means it never 
expires Data storage time (unit: ms,-1 means never expire)
-         *                   Note: Why is String used here instead of Long? At 
present, the set ttl of IoTDB only supports milliseconds as a unit,
-         *                   and other units may be added later, so the String 
type is used for compatibility Data storage time (unit: ms, -1 means never 
expires)
-         *                   Note: Why use String instead of Long here? 
Currently, IoTDB's set ttl only supports milliseconds as the unit.
-         *                   Other units may be added later. In order to be 
compatible with the future, the String type is used.
-         */
-        public record IotDbProperties(
-                @DefaultValue("false") boolean enabled,
-                @DefaultValue("127.0.0.1") String host,
-                @DefaultValue("6667") Integer rpcPort,
-                String username,
-                String password,
-                List<String> nodeUrls,
-                ZoneId zoneId,
-                IotDbVersion version,
-                long queryTimeoutInMs,
-                String expireTime) {}
-
-        /**
-         * GrepTimeDB configuration information
-         */
-        public record GreptimeProperties(
-                @DefaultValue("false") boolean enabled,
-                @DefaultValue("127.0.0.1:4001") String endpoint,
-                String username,
-                String password) {}
-    }
-
-}
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/entrance/KafkaProperties.java
similarity index 54%
copy from 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
copy to 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/entrance/KafkaProperties.java
index 184ec9ef7..a15807054 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/entrance/KafkaProperties.java
@@ -15,16 +15,19 @@
  * limitations under the License.
  */
 
-package org.apache.hertzbeat.warehouse.config;
+package org.apache.hertzbeat.warehouse.config.entrance;
 
-import 
org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.ComponentScan;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
+import org.springframework.boot.context.properties.bind.DefaultValue;
 
 /**
- * WarehouseAutoConfiguration class
- * @version 2.1
+ * kafka configuration information
  */
-@ComponentScan(basePackages = "org.apache.hertzbeat.warehouse")
-@EnableConfigurationProperties(WarehouseProperties.class)
-public class WarehouseAutoConfiguration {
+@ConfigurationProperties(prefix = "warehouse.entrance.kafka")
+@ConfigurationPropertiesScan("org.apache.hertzbeat.warehouse.config")
+public record KafkaProperties(@DefaultValue("true") boolean enabled,
+                              @DefaultValue("127.0.0.1:9092") String servers,
+                              String topic,
+                              String groupId) {
 }
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/StoreProperties.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/StoreProperties.java
new file mode 100644
index 000000000..7e7bf2754
--- /dev/null
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/StoreProperties.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hertzbeat.warehouse.config.store;
+
+import org.apache.hertzbeat.warehouse.config.store.greptime.GreptimeProperties;
+import org.apache.hertzbeat.warehouse.config.store.influxdb.InfluxdbProperties;
+import org.apache.hertzbeat.warehouse.config.store.iotdb.IotDbProperties;
+import org.apache.hertzbeat.warehouse.config.store.jpa.JpaProperties;
+import org.apache.hertzbeat.warehouse.config.store.memory.MemoryProperties;
+import org.apache.hertzbeat.warehouse.config.store.redis.RedisProperties;
+import org.apache.hertzbeat.warehouse.config.store.tdengine.TdEngineProperties;
+import 
org.apache.hertzbeat.warehouse.config.store.vm.VictoriaMetricsProperties;
+
+/**
+ * Scheduling data export configuration properties
+ * @param jpa use mysql/h2 jpa store metrics history data
+ * @param memory Memory storage configuration information
+ * @param influxdb influxdb configuration information
+ * @param redis redis configuration information
+ * @param victoriaMetrics VictoriaMetrics Properties
+ * @param tdEngine TdEngine configuration information
+ * @param iotDb IoTDB configuration information
+ * @param greptime GrepTimeDB Config
+ */
+public record StoreProperties(JpaProperties jpa, MemoryProperties memory, 
InfluxdbProperties influxdb,
+                              RedisProperties redis, VictoriaMetricsProperties 
victoriaMetrics,
+                              TdEngineProperties tdEngine, IotDbProperties 
iotDb, GreptimeProperties greptime) {
+
+}
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/greptime/GreptimeProperties.java
similarity index 58%
copy from 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
copy to 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/greptime/GreptimeProperties.java
index 184ec9ef7..b7d439d21 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/greptime/GreptimeProperties.java
@@ -15,16 +15,17 @@
  * limitations under the License.
  */
 
-package org.apache.hertzbeat.warehouse.config;
+package org.apache.hertzbeat.warehouse.config.store.greptime;
 
-import 
org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.ComponentScan;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.bind.DefaultValue;
 
 /**
- * WarehouseAutoConfiguration class
- * @version 2.1
+ * GrepTimeDB configuration information
  */
-@ComponentScan(basePackages = "org.apache.hertzbeat.warehouse")
-@EnableConfigurationProperties(WarehouseProperties.class)
-public class WarehouseAutoConfiguration {
+@ConfigurationProperties(prefix = "warehouse.store.greptime")
+public record GreptimeProperties(@DefaultValue("false") boolean enabled,
+                                 @DefaultValue("127.0.0.1:4001") String 
endpoint,
+                                 String username,
+                                 String password) {
 }
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/influxdb/InfluxdbProperties.java
similarity index 54%
copy from 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
copy to 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/influxdb/InfluxdbProperties.java
index 184ec9ef7..3dcbb2207 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/influxdb/InfluxdbProperties.java
@@ -15,16 +15,19 @@
  * limitations under the License.
  */
 
-package org.apache.hertzbeat.warehouse.config;
+package org.apache.hertzbeat.warehouse.config.store.influxdb;
 
-import 
org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.ComponentScan;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.bind.DefaultValue;
 
 /**
- * WarehouseAutoConfiguration class
- * @version 2.1
+ * Influxdb configuration information
  */
-@ComponentScan(basePackages = "org.apache.hertzbeat.warehouse")
-@EnableConfigurationProperties(WarehouseProperties.class)
-public class WarehouseAutoConfiguration {
+@ConfigurationProperties(prefix = "warehouse.store.influxdb")
+public record InfluxdbProperties(@DefaultValue("false") boolean enabled,
+                                 String serverUrl,
+                                 String username,
+                                 String password,
+                                 @DefaultValue("30d") String expireTime,
+                                 @DefaultValue("1") int replication) {
 }
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/iotdb/IotDbProperties.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/iotdb/IotDbProperties.java
new file mode 100644
index 000000000..28b964dbd
--- /dev/null
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/iotdb/IotDbProperties.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hertzbeat.warehouse.config.store.iotdb;
+
+import java.time.ZoneId;
+import java.util.List;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.bind.DefaultValue;
+
+
+
+/**
+ * IotDB configuration information
+ * @param enabled Whether the iotDB data store is enabled
+ * @param host iotDB host
+ * @param expireTime save data expire time(ms),-1 means it never expires Data 
storage time (unit: ms,-1 means never expire)
+ *                   Note: Why is String used here instead of Long? At 
present, the set ttl of IoTDB only supports milliseconds as a unit,
+ *                   and other units may be added later, so the String type is 
used for compatibility Data storage time (unit: ms, -1 means never expires)
+ *                   Note: Why use String instead of Long here? Currently, 
IoTDB's set ttl only supports milliseconds as the unit.
+ *                   Other units may be added later. In order to be compatible 
with the future, the String type is used.
+ */
+@ConfigurationProperties(prefix = "warehouse.store.iot-db")
+public record IotDbProperties(@DefaultValue("false") boolean enabled,
+                              @DefaultValue("127.0.0.1") String host,
+                              @DefaultValue("6667") Integer rpcPort,
+                              String username,
+                              String password,
+                              List<String> nodeUrls,
+                              ZoneId zoneId,
+                              IotDbVersion version,
+                              long queryTimeoutInMs,
+                              String expireTime) {
+}
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/IotDbVersion.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/iotdb/IotDbVersion.java
similarity index 94%
rename from 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/IotDbVersion.java
rename to 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/iotdb/IotDbVersion.java
index 0a356e809..ae51e63b2 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/IotDbVersion.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/iotdb/IotDbVersion.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.hertzbeat.warehouse.config;
+package org.apache.hertzbeat.warehouse.config.store.iotdb;
 
 /**
  * IoTDB user version
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/jpa/JpaProperties.java
similarity index 53%
copy from 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
copy to 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/jpa/JpaProperties.java
index 184ec9ef7..986b824bf 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/jpa/JpaProperties.java
@@ -15,16 +15,19 @@
  * limitations under the License.
  */
 
-package org.apache.hertzbeat.warehouse.config;
+package org.apache.hertzbeat.warehouse.config.store.jpa;
 
-import 
org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.ComponentScan;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.bind.DefaultValue;
 
 /**
- * WarehouseAutoConfiguration class
- * @version 2.1
+ * JPA configuration information
+ * @param enabled use mysql/h2 jpa store metrics history data
+ * @param expireTime save data expire time(ms)
+ * @param maxHistoryRecordNum The maximum number of history records retained
  */
-@ComponentScan(basePackages = "org.apache.hertzbeat.warehouse")
-@EnableConfigurationProperties(WarehouseProperties.class)
-public class WarehouseAutoConfiguration {
+@ConfigurationProperties(prefix = "warehouse.store.jpa")
+public record JpaProperties(@DefaultValue("true") boolean enabled,
+                            @DefaultValue("1h") String expireTime,
+                            @DefaultValue("20000") Integer 
maxHistoryRecordNum) {
 }
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/memory/MemoryProperties.java
similarity index 58%
copy from 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
copy to 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/memory/MemoryProperties.java
index 184ec9ef7..12003e250 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/memory/MemoryProperties.java
@@ -15,16 +15,17 @@
  * limitations under the License.
  */
 
-package org.apache.hertzbeat.warehouse.config;
+package org.apache.hertzbeat.warehouse.config.store.memory;
 
-import 
org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.ComponentScan;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.bind.DefaultValue;
 
 /**
- * WarehouseAutoConfiguration class
- * @version 2.1
+ * Memory storage configuration information
+ * @param enabled Whether memory data storage is enabled
+ * @param initSize Memory storage map initialization size
  */
-@ComponentScan(basePackages = "org.apache.hertzbeat.warehouse")
-@EnableConfigurationProperties(WarehouseProperties.class)
-public class WarehouseAutoConfiguration {
+@ConfigurationProperties(prefix = "warehouse.store.memory")
+public record MemoryProperties(@DefaultValue("true") boolean enabled,
+                               @DefaultValue("1024") Integer initSize) {
 }
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/redis/RedisProperties.java
similarity index 56%
copy from 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
copy to 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/redis/RedisProperties.java
index 184ec9ef7..93f2d5ed9 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/redis/RedisProperties.java
@@ -15,16 +15,18 @@
  * limitations under the License.
  */
 
-package org.apache.hertzbeat.warehouse.config;
+package org.apache.hertzbeat.warehouse.config.store.redis;
 
-import 
org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.ComponentScan;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.bind.DefaultValue;
 
 /**
- * WarehouseAutoConfiguration class
- * @version 2.1
+ * Redis configuration information
  */
-@ComponentScan(basePackages = "org.apache.hertzbeat.warehouse")
-@EnableConfigurationProperties(WarehouseProperties.class)
-public class WarehouseAutoConfiguration {
+@ConfigurationProperties(prefix = "warehouse.store.redis")
+public record RedisProperties(@DefaultValue("false") boolean enabled,
+                              @DefaultValue("127.0.0.1") String host,
+                              @DefaultValue("6379") Integer port,
+                              String password,
+                              @DefaultValue("0") Integer db) {
 }
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/tdengine/TdEngineProperties.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/tdengine/TdEngineProperties.java
new file mode 100644
index 000000000..313a8c239
--- /dev/null
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/tdengine/TdEngineProperties.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hertzbeat.warehouse.config.store.tdengine;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.bind.DefaultValue;
+
+/**
+ *
+ * @param enabled Whether the TdEngine data store is enabled
+ * @param url TdEngine connect url
+ * @param driverClassName tdengine driver, default restful driver
+ * @param username tdengine username
+ * @param password  tdengine password
+ * @param tableStrColumnDefineMaxLength auto create table's string column 
define max length : NCHAR(200)
+ */
+@ConfigurationProperties(prefix = "warehouse.store.td-engine")
+public record TdEngineProperties(@DefaultValue("false") boolean enabled,
+                                 
@DefaultValue("jdbc:TAOS-RS://localhost:6041/demo") String url,
+                                 
@DefaultValue("com.taosdata.jdbc.rs.RestfulDriver") String driverClassName,
+                                 String username, String password,
+                                 @DefaultValue("200") int 
tableStrColumnDefineMaxLength) {
+}
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/vm/VictoriaMetricsProperties.java
similarity index 57%
copy from 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
copy to 
warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/vm/VictoriaMetricsProperties.java
index 184ec9ef7..f6cf555e3 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/store/vm/VictoriaMetricsProperties.java
@@ -15,16 +15,17 @@
  * limitations under the License.
  */
 
-package org.apache.hertzbeat.warehouse.config;
+package org.apache.hertzbeat.warehouse.config.store.vm;
 
-import 
org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.ComponentScan;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.bind.DefaultValue;
 
 /**
- * WarehouseAutoConfiguration class
- * @version 2.1
+ * Victoriametrics configuration information
  */
-@ComponentScan(basePackages = "org.apache.hertzbeat.warehouse")
-@EnableConfigurationProperties(WarehouseProperties.class)
-public class WarehouseAutoConfiguration {
+@ConfigurationProperties(prefix = "warehouse.store.victoria-metrics")
+public record VictoriaMetricsProperties(@DefaultValue("false") boolean enabled,
+                                        @DefaultValue("http://localhost:8428";) 
String url,
+                                        String username,
+                                        String password) {
 }
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryGrepTimeDbDataStorage.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryGrepTimeDbDataStorage.java
index eaea35952..06c52fa0f 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryGrepTimeDbDataStorage.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryGrepTimeDbDataStorage.java
@@ -53,7 +53,7 @@ import org.apache.hertzbeat.common.entity.dto.Value;
 import org.apache.hertzbeat.common.entity.message.CollectRep;
 import org.apache.hertzbeat.common.util.JsonUtil;
 import org.apache.hertzbeat.common.util.TimePeriodUtil;
-import org.apache.hertzbeat.warehouse.config.WarehouseProperties;
+import org.apache.hertzbeat.warehouse.config.store.greptime.GreptimeProperties;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.stereotype.Component;
 
@@ -83,11 +83,11 @@ public class HistoryGrepTimeDbDataStorage extends 
AbstractHistoryDataStorage {
     private static final String DATABASE_NOT_EXIST = "not exist";
     private GreptimeDB greptimeDb;
 
-    public HistoryGrepTimeDbDataStorage(WarehouseProperties properties) {
-        this.serverAvailable = 
this.initDbSession(properties.store().greptime());
+    public HistoryGrepTimeDbDataStorage(GreptimeProperties greptimeProperties) 
{
+        this.serverAvailable = this.initDbSession(greptimeProperties);
     }
 
-    private boolean 
initDbSession(WarehouseProperties.StoreProperties.GreptimeProperties 
properties) {
+    private boolean initDbSession(GreptimeProperties properties) {
         String endpoint = properties.endpoint();
         GreptimeOptions opts = GreptimeOptions.newBuilder(endpoint)
                 .writeMaxRetries(1)
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryInfluxdbDataStorage.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryInfluxdbDataStorage.java
index d86f9beb5..522736c94 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryInfluxdbDataStorage.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryInfluxdbDataStorage.java
@@ -40,7 +40,7 @@ import org.apache.hertzbeat.common.constants.CommonConstants;
 import org.apache.hertzbeat.common.entity.dto.Value;
 import org.apache.hertzbeat.common.entity.message.CollectRep;
 import org.apache.hertzbeat.common.util.JsonUtil;
-import org.apache.hertzbeat.warehouse.config.WarehouseProperties;
+import org.apache.hertzbeat.warehouse.config.store.influxdb.InfluxdbProperties;
 import org.apache.http.ssl.SSLContexts;
 import org.influxdb.InfluxDB;
 import org.influxdb.InfluxDBFactory;
@@ -79,11 +79,11 @@ public class HistoryInfluxdbDataStorage extends 
AbstractHistoryDataStorage {
 
     private InfluxDB influxDb;
 
-    public HistoryInfluxdbDataStorage(WarehouseProperties properties) {
-        this.initInfluxDb(properties);
+    public HistoryInfluxdbDataStorage(InfluxdbProperties influxdbProperties) {
+        this.initInfluxDb(influxdbProperties);
     }
 
-    public void initInfluxDb(WarehouseProperties properties) {
+    public void initInfluxDb(InfluxdbProperties influxdbProperties) {
         OkHttpClient.Builder client = new OkHttpClient.Builder()
                 .connectTimeout(10, TimeUnit.SECONDS)
                 .writeTimeout(10, TimeUnit.SECONDS)
@@ -93,7 +93,6 @@ public class HistoryInfluxdbDataStorage extends 
AbstractHistoryDataStorage {
         client.sslSocketFactory(defaultSslSocketFactory(), 
defaultTrustManager());
         client.hostnameVerifier(noopHostnameVerifier());
 
-        WarehouseProperties.StoreProperties.InfluxdbProperties 
influxdbProperties = properties.store().influxdb();
         this.influxDb = 
InfluxDBFactory.connect(influxdbProperties.serverUrl(), 
influxdbProperties.username(), influxdbProperties.password(), client);
         // Close it if your application is terminating, or you are not using 
it anymore.
         Runtime.getRuntime().addShutdownHook(new Thread(influxDb::close));
@@ -101,7 +100,7 @@ public class HistoryInfluxdbDataStorage extends 
AbstractHistoryDataStorage {
         this.serverAvailable = this.createDatabase(influxdbProperties);
     }
 
-    private boolean 
createDatabase(WarehouseProperties.StoreProperties.InfluxdbProperties 
influxdbProperties) {
+    private boolean createDatabase(InfluxdbProperties influxdbProperties) {
         QueryResult queryResult = this.influxDb.query(new 
Query(SHOW_DATABASE));
 
         if (queryResult.hasError()) {
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryIotDbDataStorage.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryIotDbDataStorage.java
index ab928e37b..39a9358eb 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryIotDbDataStorage.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryIotDbDataStorage.java
@@ -29,8 +29,8 @@ import org.apache.hertzbeat.common.constants.CommonConstants;
 import org.apache.hertzbeat.common.entity.dto.Value;
 import org.apache.hertzbeat.common.entity.message.CollectRep;
 import org.apache.hertzbeat.common.util.JsonUtil;
-import org.apache.hertzbeat.warehouse.config.IotDbVersion;
-import org.apache.hertzbeat.warehouse.config.WarehouseProperties;
+import org.apache.hertzbeat.warehouse.config.store.iotdb.IotDbProperties;
+import org.apache.hertzbeat.warehouse.config.store.iotdb.IotDbVersion;
 import org.apache.iotdb.rpc.IoTDBConnectionException;
 import org.apache.iotdb.rpc.StatementExecutionException;
 import org.apache.iotdb.session.pool.SessionDataSetWrapper;
@@ -87,11 +87,11 @@ public class HistoryIotDbDataStorage extends 
AbstractHistoryDataStorage {
 
     private long queryTimeoutInMs;
 
-    public HistoryIotDbDataStorage(WarehouseProperties properties) {
-        this.serverAvailable = 
this.initIotDbSession(properties.store().iotDb());
+    public HistoryIotDbDataStorage(IotDbProperties iotDbProperties) {
+        this.serverAvailable = this.initIotDbSession(iotDbProperties);
     }
 
-    private boolean 
initIotDbSession(WarehouseProperties.StoreProperties.IotDbProperties 
properties) {
+    private boolean initIotDbSession(IotDbProperties properties) {
         SessionPool.Builder builder = new SessionPool.Builder();
         builder.host(properties.host());
         if (properties.rpcPort() != null) {
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryJpaDatabaseDataStorage.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryJpaDatabaseDataStorage.java
index efe9c7e4c..24c9847e7 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryJpaDatabaseDataStorage.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryJpaDatabaseDataStorage.java
@@ -42,7 +42,7 @@ import org.apache.hertzbeat.common.entity.message.CollectRep;
 import org.apache.hertzbeat.common.entity.warehouse.History;
 import org.apache.hertzbeat.common.util.JsonUtil;
 import org.apache.hertzbeat.common.util.TimePeriodUtil;
-import org.apache.hertzbeat.warehouse.config.WarehouseProperties;
+import org.apache.hertzbeat.warehouse.config.store.jpa.JpaProperties;
 import org.apache.hertzbeat.warehouse.dao.HistoryDao;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.data.domain.Sort;
@@ -58,13 +58,13 @@ import org.springframework.stereotype.Component;
 @Slf4j
 public class HistoryJpaDatabaseDataStorage extends AbstractHistoryDataStorage {
     private final HistoryDao historyDao;
-    private final WarehouseProperties.StoreProperties.JpaProperties 
jpaProperties;
+    private final JpaProperties jpaProperties;
 
     private static final int STRING_MAX_LENGTH = 1024;
 
-    public HistoryJpaDatabaseDataStorage(WarehouseProperties properties,
+    public HistoryJpaDatabaseDataStorage(JpaProperties jpaProperties,
                                          HistoryDao historyDao) {
-        this.jpaProperties = properties.store().jpa();
+        this.jpaProperties = jpaProperties;
         this.serverAvailable = true;
         this.historyDao = historyDao;
         expiredDataCleaner();
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java
index 490377da7..d760f3a17 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java
@@ -37,7 +37,7 @@ import org.apache.hertzbeat.common.constants.CommonConstants;
 import org.apache.hertzbeat.common.entity.dto.Value;
 import org.apache.hertzbeat.common.entity.message.CollectRep;
 import org.apache.hertzbeat.common.util.JsonUtil;
-import org.apache.hertzbeat.warehouse.config.WarehouseProperties;
+import org.apache.hertzbeat.warehouse.config.store.tdengine.TdEngineProperties;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Component;
@@ -71,16 +71,16 @@ public class HistoryTdEngineDataStorage extends 
AbstractHistoryDataStorage {
     private HikariDataSource hikariDataSource;
     private final int tableStrColumnDefineMaxLength;
 
-    public HistoryTdEngineDataStorage(WarehouseProperties properties) {
-        if (properties == null || properties.store() == null || 
properties.store().tdEngine() == null) {
+    public HistoryTdEngineDataStorage(TdEngineProperties tdEngineProperties) {
+        if (tdEngineProperties == null) {
             log.error("init error, please config Warehouse TdEngine props in 
application.yml");
             throw new IllegalArgumentException("please config Warehouse 
TdEngine props");
         }
-        tableStrColumnDefineMaxLength = 
properties.store().tdEngine().tableStrColumnDefineMaxLength();
-        serverAvailable = 
initTdEngineDatasource(properties.store().tdEngine());
+        tableStrColumnDefineMaxLength = 
tdEngineProperties.tableStrColumnDefineMaxLength();
+        serverAvailable = initTdEngineDatasource(tdEngineProperties);
     }
 
-    private boolean 
initTdEngineDatasource(WarehouseProperties.StoreProperties.TdEngineProperties 
tdEngineProperties) {
+    private boolean initTdEngineDatasource(TdEngineProperties 
tdEngineProperties) {
         HikariConfig config = new HikariConfig();
         // jdbc properties
         config.setJdbcUrl(tdEngineProperties.url());
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryVictoriaMetricsDataStorage.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryVictoriaMetricsDataStorage.java
index 4c27cf868..b62f7cc1b 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryVictoriaMetricsDataStorage.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/HistoryVictoriaMetricsDataStorage.java
@@ -45,7 +45,7 @@ import org.apache.hertzbeat.common.entity.message.CollectRep;
 import org.apache.hertzbeat.common.util.CommonUtil;
 import org.apache.hertzbeat.common.util.JsonUtil;
 import org.apache.hertzbeat.common.util.TimePeriodUtil;
-import org.apache.hertzbeat.warehouse.config.WarehouseProperties;
+import 
org.apache.hertzbeat.warehouse.config.store.vm.VictoriaMetricsProperties;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Primary;
 import org.springframework.http.HttpEntity;
@@ -87,17 +87,17 @@ public class HistoryVictoriaMetricsDataStorage extends 
AbstractHistoryDataStorag
     private static final String MONITOR_METRICS_KEY = "__metrics__";
     private static final String MONITOR_METRIC_KEY = "__metric__";
 
-    private final 
WarehouseProperties.StoreProperties.VictoriaMetricsProperties 
victoriaMetricsProp;
+    private final VictoriaMetricsProperties victoriaMetricsProp;
     
     private final RestTemplate restTemplate;
 
-    public HistoryVictoriaMetricsDataStorage(WarehouseProperties properties, 
RestTemplate restTemplate) {
-        if (properties == null || properties.store() == null || 
properties.store().victoriaMetrics() == null) {
+    public HistoryVictoriaMetricsDataStorage(VictoriaMetricsProperties 
victoriaMetricsProperties, RestTemplate restTemplate) {
+        if (victoriaMetricsProperties == null) {
             log.error("init error, please config Warehouse victoriaMetrics 
props in application.yml");
             throw new IllegalArgumentException("please config Warehouse 
victoriaMetrics props");
         }
         this.restTemplate = restTemplate;
-        victoriaMetricsProp = properties.store().victoriaMetrics();
+        victoriaMetricsProp = victoriaMetricsProperties;
         serverAvailable = checkVictoriaMetricsDatasourceAvailable();
     }
 
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/RealTimeMemoryDataStorage.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/RealTimeMemoryDataStorage.java
index 94beb837c..efcf6fe61 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/RealTimeMemoryDataStorage.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/RealTimeMemoryDataStorage.java
@@ -23,7 +23,7 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.hertzbeat.common.entity.message.CollectRep;
-import org.apache.hertzbeat.warehouse.config.WarehouseProperties;
+import org.apache.hertzbeat.warehouse.config.store.memory.MemoryProperties;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.lang.NonNull;
 import org.springframework.stereotype.Component;
@@ -44,11 +44,11 @@ public class RealTimeMemoryDataStorage extends 
AbstractRealTimeDataStorage {
     private static final Integer DEFAULT_INIT_SIZE = 16;
     private static final Integer METRICS_SIZE = 8;
 
-    public RealTimeMemoryDataStorage(WarehouseProperties properties) {
+    public RealTimeMemoryDataStorage(MemoryProperties memoryProperties) {
         int initSize = DEFAULT_INIT_SIZE;
-        if (properties != null && properties.store() != null && 
properties.store().memory() != null
-                && properties.store().memory().initSize() != null) {
-            initSize = properties.store().memory().initSize();
+        if (memoryProperties != null
+                && memoryProperties.initSize() != null) {
+            initSize = memoryProperties.initSize();
         }
         monitorMetricsDataMap = new ConcurrentHashMap<>(initSize);
         this.serverAvailable = true;
diff --git 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/RealTimeRedisDataStorage.java
 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/RealTimeRedisDataStorage.java
index 5d8c1459b..e5f25ad10 100644
--- 
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/RealTimeRedisDataStorage.java
+++ 
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/RealTimeRedisDataStorage.java
@@ -29,7 +29,7 @@ import java.util.List;
 import java.util.Map;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.hertzbeat.common.entity.message.CollectRep;
-import org.apache.hertzbeat.warehouse.config.WarehouseProperties;
+import org.apache.hertzbeat.warehouse.config.store.redis.RedisProperties;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Primary;
 import org.springframework.lang.NonNull;
@@ -49,13 +49,13 @@ public class RealTimeRedisDataStorage extends 
AbstractRealTimeDataStorage {
     private final Integer db;
     private StatefulRedisConnection<String, CollectRep.MetricsData> connection;
 
-    public RealTimeRedisDataStorage(WarehouseProperties properties) {
-        this.serverAvailable = initRedisClient(properties);
-        this.db = getRedisSelectDb(properties);
+    public RealTimeRedisDataStorage(RedisProperties redisProperties) {
+        this.serverAvailable = initRedisClient(redisProperties);
+        this.db = getRedisSelectDb(redisProperties);
     }
 
-    private Integer getRedisSelectDb(WarehouseProperties properties){
-        return properties.store().redis().db();
+    private Integer getRedisSelectDb(RedisProperties redisProperties){
+        return redisProperties.db();
     }
 
     @Override
@@ -95,12 +95,12 @@ public class RealTimeRedisDataStorage extends 
AbstractRealTimeDataStorage {
         });
     }
 
-    private boolean initRedisClient(WarehouseProperties properties) {
-        if (properties == null || properties.store() == null || 
properties.store().redis() == null) {
+    private boolean initRedisClient(RedisProperties redisProperties) {
+        if (redisProperties == null) {
             log.error("init error, please config Warehouse redis props in 
application.yml");
             return false;
         }
-        WarehouseProperties.StoreProperties.RedisProperties redisProp = 
properties.store().redis();
+        RedisProperties redisProp = redisProperties;
         RedisURI.Builder uriBuilder = RedisURI.builder()
                 .withHost(redisProp.host())
                 .withPort(redisProp.port())


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to