Skip to content

Commit 554759a

Browse files
author
Siarhei Vesialou
committed
move constants to separate file
1 parent 8a1730b commit 554759a

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

ydb/core/kafka_proxy/actors/kafka_create_topics_actor.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
#include <ydb/services/lib/actors/pq_schema_actor.h>
66

7-
namespace NKafka {
7+
#include <ydb/core/kafka_proxy/kafka_constants.h>
8+
89

9-
static const TString RETENTION_MS_CONFIG_NAME = "retention.ms";
10-
static const TString RETENTION_BYTES_CONFIG_NAME = "retention.bytes";
10+
namespace NKafka {
1111

1212
class TKafkaCreateTopicRequest : public NKikimr::NGRpcService::IRequestOpCtx {
1313
public:
@@ -405,9 +405,9 @@ void TKafkaCreateTopicsActor::Bootstrap(const NActors::TActorContext& ctx) {
405405
auto processConfig = [&topic, &retentionMs, &retentionBytes, &parseRetention]() -> bool {
406406
for (auto& config : topic.Configs) {
407407
bool result = true;
408-
if (config.Name.value() == "retention.bytes") {
408+
if (config.Name.value() == RETENTION_BYTES_CONFIG_NAME) {
409409
result = parseRetention(config, retentionBytes);
410-
} else if (config.Name.value() == "retention.ms") {
410+
} else if (config.Name.value() == RETENTION_MS_CONFIG_NAME) {
411411
result = parseRetention(config, retentionMs);
412412
}
413413
if (!result) {
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#pragma once
2+
3+
#include <util/generic/string.h>
4+
5+
namespace NKafka {
6+
static const TString RETENTION_MS_CONFIG_NAME = "retention.ms";
7+
static const TString RETENTION_BYTES_CONFIG_NAME = "retention.bytes";
8+
}

ydb/core/kafka_proxy/ya.make

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ SRCS(
1818
actors/kafka_create_topics_actor.cpp
1919
kafka_connection.cpp
2020
kafka_connection.h
21+
kafka_constants.h
2122
kafka_listener.h
2223
kafka.h
2324
kafka_log.h

0 commit comments

Comments
 (0)