From e47c2aa15abbb787cda72e72c28c2b3d1925a83b Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 12 Oct 2023 10:32:51 +0200 Subject: [PATCH] chore: Remove v2 suffix for replay consumer (#17938) --- ...s-consumer-v2.ts => session-recordings-consumer.ts} | 2 +- plugin-server/src/main/pluginsServer.ts | 4 ++-- ...-v2.test.ts => session-recordings-consumer.test.ts} | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) rename plugin-server/src/main/ingestion-queues/session-recording/{session-recordings-consumer-v2.ts => session-recordings-consumer.ts} (99%) rename plugin-server/tests/main/ingestion-queues/session-recording/{session-recordings-consumer-v2.test.ts => session-recordings-consumer.test.ts} (98%) diff --git a/plugin-server/src/main/ingestion-queues/session-recording/session-recordings-consumer-v2.ts b/plugin-server/src/main/ingestion-queues/session-recording/session-recordings-consumer.ts similarity index 99% rename from plugin-server/src/main/ingestion-queues/session-recording/session-recordings-consumer-v2.ts rename to plugin-server/src/main/ingestion-queues/session-recording/session-recordings-consumer.ts index 8e059d5814193..4db3a8e4a8271 100644 --- a/plugin-server/src/main/ingestion-queues/session-recording/session-recordings-consumer-v2.ts +++ b/plugin-server/src/main/ingestion-queues/session-recording/session-recordings-consumer.ts @@ -95,7 +95,7 @@ type PartitionMetrics = { lastKnownCommit?: number } -export class SessionRecordingIngesterV2 { +export class SessionRecordingIngester { redisPool: RedisPool sessions: Record = {} sessionHighWaterMarker: OffsetHighWaterMarker diff --git a/plugin-server/src/main/pluginsServer.ts b/plugin-server/src/main/pluginsServer.ts index 01e4369477006..c98a7d8cc0519 100644 --- a/plugin-server/src/main/pluginsServer.ts +++ b/plugin-server/src/main/pluginsServer.ts @@ -35,7 +35,7 @@ import { startAsyncWebhooksHandlerConsumer, } from './ingestion-queues/on-event-handler-consumer' import { startScheduledTasksConsumer } from './ingestion-queues/scheduled-tasks-consumer' -import { SessionRecordingIngesterV2 } from './ingestion-queues/session-recording/session-recordings-consumer-v2' +import { SessionRecordingIngester } from './ingestion-queues/session-recording/session-recordings-consumer' import { createHttpServer } from './services/http-server' import { getObjectStorage } from './services/object_storage' @@ -411,7 +411,7 @@ export async function startPluginsServer( throw new Error("Can't start session recording blob ingestion without object storage") } // NOTE: We intentionally pass in the original serverConfig as the ingester uses both kafkas - const ingester = new SessionRecordingIngesterV2(serverConfig, postgres, s3) + const ingester = new SessionRecordingIngester(serverConfig, postgres, s3) await ingester.start() const batchConsumer = ingester.batchConsumer diff --git a/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer-v2.test.ts b/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer.test.ts similarity index 98% rename from plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer-v2.test.ts rename to plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer.test.ts index 33364eaed9245..b9eb4981ff794 100644 --- a/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer-v2.test.ts +++ b/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer.test.ts @@ -5,7 +5,7 @@ import path from 'path' import { waitForExpect } from '../../../../functional_tests/expectations' import { defaultConfig } from '../../../../src/config/config' -import { SessionRecordingIngesterV2 } from '../../../../src/main/ingestion-queues/session-recording/session-recordings-consumer-v2' +import { SessionRecordingIngester } from '../../../../src/main/ingestion-queues/session-recording/session-recordings-consumer' import { Hub, PluginsServerConfig, Team } from '../../../../src/types' import { createHub } from '../../../../src/utils/db/hub' import { getFirstTeam, resetTestDatabase } from '../../../helpers/sql' @@ -57,7 +57,7 @@ jest.mock('../../../../src/kafka/batch-consumer', () => { jest.setTimeout(1000) describe('ingester', () => { - let ingester: SessionRecordingIngesterV2 + let ingester: SessionRecordingIngester let hub: Hub let closeHub: () => Promise @@ -76,7 +76,7 @@ describe('ingester', () => { teamToken = team.api_token await deleteKeysWithPrefix(hub) - ingester = new SessionRecordingIngesterV2(config, hub.postgres, hub.objectStorage) + ingester = new SessionRecordingIngester(config, hub.postgres, hub.objectStorage) await ingester.start() nextOffset = 1 @@ -522,11 +522,11 @@ describe('ingester', () => { }) describe('simulated rebalancing', () => { - let otherIngester: SessionRecordingIngesterV2 + let otherIngester: SessionRecordingIngester jest.setTimeout(5000) // Increased to cover lock delay beforeEach(async () => { - otherIngester = new SessionRecordingIngesterV2(config, hub.postgres, hub.objectStorage) + otherIngester = new SessionRecordingIngester(config, hub.postgres, hub.objectStorage) await otherIngester.start() })