Skip to content

Commit 2304a6c

Browse files
committed
[C++ SDK] Fixed register of GZIP and ZSTD codecs in topic client (#17192)
1 parent c41c3e7 commit 2304a6c

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/client/topic/codecs/codecs.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,16 @@ std::unique_ptr<IOutputStream> TUnsupportedCodec::CreateCoder(TBuffer&, int) con
6363
throw yexception() << "use of unsupported codec";
6464
}
6565

66+
class TCommonCodecsProvider {
67+
public:
68+
TCommonCodecsProvider() {
69+
TCodecMap::GetTheCodecMap().Set((uint32_t)ECodec::GZIP, std::make_unique<TGzipCodec>());
70+
TCodecMap::GetTheCodecMap().Set((uint32_t)ECodec::ZSTD, std::make_unique<TZstdCodec>());
71+
}
72+
};
73+
74+
namespace {
75+
TCommonCodecsProvider COMMON_CODECS_PROVIDER;
76+
}
77+
6678
}; // namespace NYdb::NTopic

src/client/topic/impl/topic.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@
1111

1212
namespace NYdb::inline V3::NTopic {
1313

14-
class TCommonCodecsProvider {
15-
public:
16-
TCommonCodecsProvider() {
17-
TCodecMap::GetTheCodecMap().Set((uint32_t)ECodec::GZIP, std::make_unique<TGzipCodec>());
18-
TCodecMap::GetTheCodecMap().Set((uint32_t)ECodec::ZSTD, std::make_unique<TZstdCodec>());
19-
}
20-
};
21-
TCommonCodecsProvider COMMON_CODECS_PROVIDER;
22-
2314
TDescribeTopicResult::TDescribeTopicResult(TStatus&& status, Ydb::Topic::DescribeTopicResult&& result)
2415
: TStatus(std::move(status))
2516
, TopicDescription_(std::move(result))

0 commit comments

Comments
 (0)