refactor: make raw archive store optional

This commit is contained in:
lingniu
2026-07-01 07:42:16 +08:00
parent ba4bb51a07
commit 51b1dd4174
4 changed files with 29 additions and 1 deletions

View File

@@ -90,3 +90,12 @@
2. vehicle-state-service 仅保留在 `optional-latest-state` profile需要 Redis 最新状态查询能力时显式构建。 2. vehicle-state-service 仅保留在 `optional-latest-state` profile需要 Redis 最新状态查询能力时显式构建。
3. 默认优化和验证优先覆盖活跃接入、TDengine 历史和 MySQL 指标链路。 3. 默认优化和验证优先覆盖活跃接入、TDengine 历史和 MySQL 指标链路。
- **Consequences**: 默认构建和部署边界继续收窄;最新状态能力保持源码可用,但其测试需要通过 `-Poptional-latest-state` 显式运行。 - **Consequences**: 默认构建和部署边界继续收窄;最新状态能力保持源码可用,但其测试需要通过 `-Poptional-latest-state` 显式运行。
## ADR-014 raw-archive-store 原型实现Optional only
- **Status**: Accepted
- **Context**: 默认生产 raw bytes 写入由 `sink-archive` 负责,历史查询通过 TDengine `raw_frames``archive://...` 引用追溯;`raw-archive-store` 当前只是独立读写接口和本地实现原型,没有默认 app 或 service 依赖。
- **Decision**:
1. `raw-archive-store` 不进入默认 Maven reactor。
2. raw-archive-store 仅保留在 `optional-raw-archive-store` profile需要验证本地读写原型时显式构建。
3. 默认生产链路继续以 `sink-archive`、Kafka raw topic、TDengine raw_frames 为准。
- **Consequences**: 默认构建少一个未部署模块;本地 raw archive 原型仍可通过 `-Poptional-raw-archive-store` 保留和验证。

View File

@@ -188,6 +188,8 @@ flowchart LR
`optional-attachments`. `optional-attachments`.
- vehicle-state-service is absent from the default Maven reactor and available - vehicle-state-service is absent from the default Maven reactor and available
through `optional-latest-state`. through `optional-latest-state`.
- raw-archive-store is absent from the default Maven reactor and available
through `optional-raw-archive-store`.
- History APIs read from TDengine by default; Parquet/DuckDB is optional - History APIs read from TDengine by default; Parquet/DuckDB is optional
compatibility only. compatibility only.
- Raw frame queries can return complete parsed JSON through `payloadJson.parsed`. - Raw frame queries can return complete parsed JSON through `payloadJson.parsed`.

View File

@@ -52,6 +52,17 @@ class MavenModuleProfileTest {
.containsExactly("modules/services/vehicle-state-service"); .containsExactly("modules/services/vehicle-state-service");
} }
@Test
void rawArchiveStorePrototypeIsOptionalAndOutsideDefaultProductionReactor() throws Exception {
Document pom = rootPom();
assertThat(defaultModules(pom))
.doesNotContain("modules/sinks/raw-archive-store");
assertThat(profileModules(pom, "optional-raw-archive-store"))
.containsExactly("modules/sinks/raw-archive-store");
}
@Test @Test
void xindaIsLegacyOnlyAndOutsideDefaultProductionReactor() throws Exception { void xindaIsLegacyOnlyAndOutsideDefaultProductionReactor() throws Exception {
Document pom = rootPom(); Document pom = rootPom();
@@ -121,6 +132,7 @@ class MavenModuleProfileTest {
.contains("Xinda Push 仅保留在 `legacy-xinda` profile") .contains("Xinda Push 仅保留在 `legacy-xinda` profile")
.contains("JSATL12 仅保留在 `optional-attachments` profile") .contains("JSATL12 仅保留在 `optional-attachments` profile")
.contains("vehicle-state-service 仅保留在 `optional-latest-state` profile") .contains("vehicle-state-service 仅保留在 `optional-latest-state` profile")
.contains("raw-archive-store 仅保留在 `optional-raw-archive-store` profile")
.doesNotContain("## ADR-004 信达 Push保留模块但彻底重写\n- **Status**: Accepted") .doesNotContain("## ADR-004 信达 Push保留模块但彻底重写\n- **Status**: Accepted")
.doesNotContain("Spring Boot 3.4.x"); .doesNotContain("Spring Boot 3.4.x");
} }

View File

@@ -26,7 +26,6 @@
<module>modules/core/observability</module> <module>modules/core/observability</module>
<module>modules/sinks/sink-mq</module> <module>modules/sinks/sink-mq</module>
<module>modules/sinks/sink-archive</module> <module>modules/sinks/sink-archive</module>
<module>modules/sinks/raw-archive-store</module>
<module>modules/sinks/event-file-store</module> <module>modules/sinks/event-file-store</module>
<module>modules/sinks/tdengine-history-store</module> <module>modules/sinks/tdengine-history-store</module>
<module>modules/services/event-history-service</module> <module>modules/services/event-history-service</module>
@@ -61,6 +60,12 @@
<module>modules/services/vehicle-state-service</module> <module>modules/services/vehicle-state-service</module>
</modules> </modules>
</profile> </profile>
<profile>
<id>optional-raw-archive-store</id>
<modules>
<module>modules/sinks/raw-archive-store</module>
</modules>
</profile>
<profile> <profile>
<id>legacy-xinda</id> <id>legacy-xinda</id>
<modules> <modules>