diff options
author | alexnick <alexnick@ydb.tech> | 2022-12-02 15:47:53 +0300 |
---|---|---|
committer | alexnick <alexnick@ydb.tech> | 2022-12-02 15:47:53 +0300 |
commit | 1972eeb85e4faf4fbf5b5bc6d8224b0707728ed0 (patch) | |
tree | 26cd5a35fed23ba5b8b2feb75fbc9de9eda92837 | |
parent | 37960f794987f2412b440c0f8cd8ccb9c8fa7de4 (diff) | |
download | ydb-1972eeb85e4faf4fbf5b5bc6d8224b0707728ed0.tar.gz |
provide codec in get records
provide codec in get records
-rw-r--r-- | ydb/public/api/protos/draft/datastreams.proto | 2 | ||||
-rw-r--r-- | ydb/services/datastreams/datastreams_proxy.cpp | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/ydb/public/api/protos/draft/datastreams.proto b/ydb/public/api/protos/draft/datastreams.proto index e55c38a119..d2825e065e 100644 --- a/ydb/public/api/protos/draft/datastreams.proto +++ b/ydb/public/api/protos/draft/datastreams.proto @@ -75,6 +75,8 @@ message Record { string partition_key = 4; // Unique id of the record within shard string sequence_number = 5; + // Codec id from ydb_topic.proto if data is coded + int32 codec = 6; } // Represents the stream description diff --git a/ydb/services/datastreams/datastreams_proxy.cpp b/ydb/services/datastreams/datastreams_proxy.cpp index 95e1edadd0..7364e91053 100644 --- a/ydb/services/datastreams/datastreams_proxy.cpp +++ b/ydb/services/datastreams/datastreams_proxy.cpp @@ -1465,6 +1465,9 @@ namespace NKikimr::NDataStreams::V1 { record.set_encryption(Ydb::DataStreams::V1::EncryptionType::NONE); record.set_partition_key(r.GetPartitionKey()); record.set_sequence_number(std::to_string(r.GetOffset()).c_str()); + if (proto.GetCodec() > 0) { + record.set_codec(proto.GetCodec() + 1); + } records.push_back(record); } millisBehindLatestMs = records.size() > 0 |