Skip to content

Commit

Permalink
move constants to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
Siarhei Vesialou committed Dec 28, 2023
1 parent 8a1730b commit 554759a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ydb/core/kafka_proxy/actors/kafka_create_topics_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

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

namespace NKafka {
#include <ydb/core/kafka_proxy/kafka_constants.h>


static const TString RETENTION_MS_CONFIG_NAME = "retention.ms";
static const TString RETENTION_BYTES_CONFIG_NAME = "retention.bytes";
namespace NKafka {

class TKafkaCreateTopicRequest : public NKikimr::NGRpcService::IRequestOpCtx {
public:
Expand Down Expand Up @@ -405,9 +405,9 @@ void TKafkaCreateTopicsActor::Bootstrap(const NActors::TActorContext& ctx) {
auto processConfig = [&topic, &retentionMs, &retentionBytes, &parseRetention]() -> bool {
for (auto& config : topic.Configs) {
bool result = true;
if (config.Name.value() == "retention.bytes") {
if (config.Name.value() == RETENTION_BYTES_CONFIG_NAME) {
result = parseRetention(config, retentionBytes);
} else if (config.Name.value() == "retention.ms") {
} else if (config.Name.value() == RETENTION_MS_CONFIG_NAME) {
result = parseRetention(config, retentionMs);
}
if (!result) {
Expand Down
8 changes: 8 additions & 0 deletions ydb/core/kafka_proxy/kafka_constants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

#include <util/generic/string.h>

namespace NKafka {
static const TString RETENTION_MS_CONFIG_NAME = "retention.ms";
static const TString RETENTION_BYTES_CONFIG_NAME = "retention.bytes";
}
1 change: 1 addition & 0 deletions ydb/core/kafka_proxy/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SRCS(
actors/kafka_create_topics_actor.cpp
kafka_connection.cpp
kafka_connection.h
kafka_constants.h
kafka_listener.h
kafka.h
kafka_log.h
Expand Down

0 comments on commit 554759a

Please sign in to comment.