aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkomels <komels@ydb.tech>2022-09-01 09:32:07 +0300
committerkomels <komels@ydb.tech>2022-09-01 09:32:07 +0300
commit0e6a777dc2bc86bbf2f7e866a2cf3ae0539b34fd (patch)
tree534d48ae17c28ddf362e8b9bbc8559fc21f0e272
parent7d5476fba99311601d2d2333696c9be1496b5553 (diff)
downloadydb-0e6a777dc2bc86bbf2f7e866a2cf3ae0539b34fd.tar.gz
Bugfix
-rw-r--r--ydb/library/persqueue/topic_parser/topic_parser.h8
-rw-r--r--ydb/library/persqueue/topic_parser/ut/topic_names_converter_ut.cpp5
2 files changed, 11 insertions, 2 deletions
diff --git a/ydb/library/persqueue/topic_parser/topic_parser.h b/ydb/library/persqueue/topic_parser/topic_parser.h
index 3fec6e0f6a9..627785eef52 100644
--- a/ydb/library/persqueue/topic_parser/topic_parser.h
+++ b/ydb/library/persqueue/topic_parser/topic_parser.h
@@ -278,12 +278,16 @@ class TTopicNamesConverterFactory {
public:
TTopicNamesConverterFactory(
bool noDcMode, const TString& pqRootPrefix,
- const TString& localDc
+ const TString& localDc, TMaybe<bool> isLocalDc = Nothing()
)
: NoDcMode(noDcMode)
, PQRootPrefix(pqRootPrefix)
- , LocalDc(localDc)
{
+ if (isLocalDc.Defined()) {
+ IsLocalDc = *isLocalDc;
+ } else {
+ LocalDc = localDc;
+ }
SetPQNormPrefix();
}
diff --git a/ydb/library/persqueue/topic_parser/ut/topic_names_converter_ut.cpp b/ydb/library/persqueue/topic_parser/ut/topic_names_converter_ut.cpp
index 9caf5ee2f3e..c8e3bbc8043 100644
--- a/ydb/library/persqueue/topic_parser/ut/topic_names_converter_ut.cpp
+++ b/ydb/library/persqueue/topic_parser/ut/topic_names_converter_ut.cpp
@@ -284,6 +284,11 @@ Y_UNIT_TEST_SUITE(TopicNameConverterTest) {
UNIT_ASSERT_VALUES_EQUAL(wrapper.TopicConverter->GetFederationPath(), "my-stream");
UNIT_ASSERT_VALUES_EQUAL(wrapper.TopicConverter->GetInternalName(), "/lb/database/my-stream");
}
+ Y_UNIT_TEST(PathFromDiscoveryConverter) {
+ auto converterFactory = NPersQueue::TTopicNamesConverterFactory(false, "/Root/PQ", TString(), false);
+ auto converter = converterFactory.MakeDiscoveryConverter("topic1", false, "other", "database1");
+ UNIT_ASSERT_VALUES_EQUAL(converter->GetFullModernName(), "topic1-mirrored-from-other");
+ }
}
Y_UNIT_TEST_SUITE(TopicNameConverterForCPTest) {