refactor(events): remove dead non-paginated query path
AgentEventService.queryEvents, AgentEventRepository.query, and the ClickHouse implementation have had no callers since /agents/events became cursor-paginated. Remove them along with their dedicated IT tests. queryPage and its tests remain as the single query path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,30 +40,6 @@ public class ClickHouseAgentEventRepository implements AgentEventRepository {
|
||||
environment != null ? environment : "default", eventType, detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AgentEventRecord> query(String applicationId, String instanceId, String environment, Instant from, Instant to, int limit) {
|
||||
var sql = new StringBuilder(SELECT_BASE);
|
||||
var params = new ArrayList<Object>();
|
||||
params.add(tenantId);
|
||||
|
||||
if (applicationId != null) { sql.append(" AND application_id = ?"); params.add(applicationId); }
|
||||
if (instanceId != null) { sql.append(" AND instance_id = ?"); params.add(instanceId); }
|
||||
if (environment != null) { sql.append(" AND environment = ?"); params.add(environment); }
|
||||
if (from != null) { sql.append(" AND timestamp >= ?"); params.add(Timestamp.from(from)); }
|
||||
if (to != null) { sql.append(" AND timestamp < ?"); params.add(Timestamp.from(to)); }
|
||||
sql.append(" ORDER BY timestamp DESC LIMIT ?");
|
||||
params.add(limit);
|
||||
|
||||
return jdbc.query(sql.toString(), (rs, rowNum) -> new AgentEventRecord(
|
||||
rs.getLong("id"),
|
||||
rs.getString("instance_id"),
|
||||
rs.getString("application_id"),
|
||||
rs.getString("event_type"),
|
||||
rs.getString("detail"),
|
||||
rs.getTimestamp("timestamp").toInstant()
|
||||
), params.toArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AgentEventPage queryPage(String applicationId, String instanceId, String environment,
|
||||
Instant from, Instant to, String cursor, int limit) {
|
||||
|
||||
Reference in New Issue
Block a user