feat(clickhouse): wire ClickHouseExecutionStore as active ExecutionStore
Add cameleer.storage.executions feature flag (default: clickhouse). PostgresExecutionStore activates only when explicitly set to postgres. Add by-seq snapshot endpoint for iteration-aware processor lookup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import com.cameleer3.server.app.storage.ClickHouseDiagramStore;
|
|||||||
import com.cameleer3.server.app.storage.ClickHouseMetricsQueryStore;
|
import com.cameleer3.server.app.storage.ClickHouseMetricsQueryStore;
|
||||||
import com.cameleer3.server.app.storage.ClickHouseMetricsStore;
|
import com.cameleer3.server.app.storage.ClickHouseMetricsStore;
|
||||||
import com.cameleer3.server.app.storage.ClickHouseStatsStore;
|
import com.cameleer3.server.app.storage.ClickHouseStatsStore;
|
||||||
|
import com.cameleer3.server.app.storage.PostgresExecutionStore;
|
||||||
import com.cameleer3.server.app.storage.PostgresMetricsQueryStore;
|
import com.cameleer3.server.app.storage.PostgresMetricsQueryStore;
|
||||||
import com.cameleer3.server.app.storage.PostgresMetricsStore;
|
import com.cameleer3.server.app.storage.PostgresMetricsStore;
|
||||||
import com.cameleer3.server.core.admin.AuditRepository;
|
import com.cameleer3.server.core.admin.AuditRepository;
|
||||||
@@ -96,6 +97,18 @@ public class StorageBeanConfig {
|
|||||||
return new ClickHouseExecutionStore(clickHouseJdbc);
|
return new ClickHouseExecutionStore(clickHouseJdbc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnProperty(name = "cameleer.storage.executions", havingValue = "clickhouse", matchIfMissing = true)
|
||||||
|
public ExecutionStore executionStoreClickHouse(ClickHouseExecutionStore chStore) {
|
||||||
|
return chStore; // Same instance, also exposed as ExecutionStore
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnProperty(name = "cameleer.storage.executions", havingValue = "postgres")
|
||||||
|
public ExecutionStore executionStorePostgres(JdbcTemplate jdbc) {
|
||||||
|
return new PostgresExecutionStore(jdbc);
|
||||||
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnProperty(name = "clickhouse.enabled", havingValue = "true")
|
@ConditionalOnProperty(name = "clickhouse.enabled", havingValue = "true")
|
||||||
public ChunkAccumulator chunkAccumulator(
|
public ChunkAccumulator chunkAccumulator(
|
||||||
|
|||||||
@@ -81,4 +81,16 @@ public class DetailController {
|
|||||||
.map(ResponseEntity::ok)
|
.map(ResponseEntity::ok)
|
||||||
.orElse(ResponseEntity.notFound().build());
|
.orElse(ResponseEntity.notFound().build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{executionId}/processors/by-seq/{seq}/snapshot")
|
||||||
|
@Operation(summary = "Get exchange snapshot for a processor by seq number")
|
||||||
|
@ApiResponse(responseCode = "200", description = "Snapshot data")
|
||||||
|
@ApiResponse(responseCode = "404", description = "Snapshot not found")
|
||||||
|
public ResponseEntity<Map<String, String>> processorSnapshotBySeq(
|
||||||
|
@PathVariable String executionId,
|
||||||
|
@PathVariable int seq) {
|
||||||
|
return detailService.getProcessorSnapshotBySeq(executionId, seq)
|
||||||
|
.map(ResponseEntity::ok)
|
||||||
|
.orElse(ResponseEntity.notFound().build());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.cameleer3.server.app.storage;
|
|||||||
import com.cameleer3.server.core.storage.ExecutionStore;
|
import com.cameleer3.server.core.storage.ExecutionStore;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.jdbc.core.RowMapper;
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -12,7 +11,6 @@ import java.time.Instant;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@Repository
|
|
||||||
public class PostgresExecutionStore implements ExecutionStore {
|
public class PostgresExecutionStore implements ExecutionStore {
|
||||||
|
|
||||||
private final JdbcTemplate jdbc;
|
private final JdbcTemplate jdbc;
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ cameleer:
|
|||||||
diagrams: ${CAMELEER_STORAGE_DIAGRAMS:clickhouse}
|
diagrams: ${CAMELEER_STORAGE_DIAGRAMS:clickhouse}
|
||||||
events: ${CAMELEER_STORAGE_EVENTS:clickhouse}
|
events: ${CAMELEER_STORAGE_EVENTS:clickhouse}
|
||||||
logs: ${CAMELEER_STORAGE_LOGS:clickhouse}
|
logs: ${CAMELEER_STORAGE_LOGS:clickhouse}
|
||||||
|
executions: ${CAMELEER_STORAGE_EXECUTIONS:clickhouse}
|
||||||
|
|
||||||
security:
|
security:
|
||||||
access-token-expiry-ms: 3600000
|
access-token-expiry-ms: 3600000
|
||||||
|
|||||||
@@ -101,6 +101,8 @@ spec:
|
|||||||
value: "clickhouse"
|
value: "clickhouse"
|
||||||
- name: CAMELEER_STORAGE_LOGS
|
- name: CAMELEER_STORAGE_LOGS
|
||||||
value: "clickhouse"
|
value: "clickhouse"
|
||||||
|
- name: CAMELEER_STORAGE_EXECUTIONS
|
||||||
|
value: "clickhouse"
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
|
|||||||
Reference in New Issue
Block a user