diff options
author | azevaykin <azevaykin@yandex-team.com> | 2023-06-02 16:45:16 +0300 |
---|---|---|
committer | azevaykin <azevaykin@yandex-team.com> | 2023-06-02 16:45:16 +0300 |
commit | 7b0b68668aa4e020c44ab92b637620432c15ecd3 (patch) | |
tree | 8e79e758c174c7af67054f4f2e7838c2d1a98480 | |
parent | a222577a9fdf332653f853e10b061c51a7f3a76c (diff) | |
download | ydb-7b0b68668aa4e020c44ab92b637620432c15ecd3.tar.gz |
move CheckBlob to TClientBlob class
-rw-r--r-- | ydb/core/persqueue/blob.cpp | 5 | ||||
-rw-r--r-- | ydb/core/persqueue/blob.h | 4 | ||||
-rw-r--r-- | ydb/core/persqueue/cache_eviction.h | 2 | ||||
-rw-r--r-- | ydb/core/persqueue/partition_write.cpp | 2 |
4 files changed, 5 insertions, 8 deletions
diff --git a/ydb/core/persqueue/blob.cpp b/ydb/core/persqueue/blob.cpp index f925152e19..80c8d8b84b 100644 --- a/ydb/core/persqueue/blob.cpp +++ b/ydb/core/persqueue/blob.cpp @@ -66,12 +66,11 @@ const TBatch& TBlobIterator::GetBatch() return Batch; } -void CheckBlob(const TKey& key, const TString& blob) +void TClientBlob::CheckBlob(const TKey& key, const TString& blob) { for (TBlobIterator it(key, blob, false); it.IsValid(); it.Next()); } - void TClientBlob::SerializeTo(TBuffer& res) const { ui32 totalSize = GetBlobSize(); @@ -856,7 +855,7 @@ std::optional<std::pair<TKey, TString>> TPartitionedBlob::Add(TClientBlob&& blob Y_VERIFY(valueD.size() <= MaxBlobSize && (valueD.size() + size + 1_MB > MaxBlobSize || HeadSize + BlobsSize + size + GetMaxHeaderSize() <= MaxBlobSize)); HeadSize = 0; BlobsSize = 0; - CheckBlob(key, valueD); + TClientBlob::CheckBlob(key, valueD); FormedBlobs.emplace_back(key, valueD.size()); Blobs.clear(); diff --git a/ydb/core/persqueue/blob.h b/ydb/core/persqueue/blob.h index 307cca7d0e..4a15fc4bad 100644 --- a/ydb/core/persqueue/blob.h +++ b/ydb/core/persqueue/blob.h @@ -12,9 +12,6 @@ namespace NKikimr { namespace NPQ { - -void CheckBlob(const TKey& key, const TString& blob); - struct TPartData { ui16 PartNo; ui16 TotalParts; @@ -96,6 +93,7 @@ struct TClientBlob { void SerializeTo(TBuffer& buffer) const; static TClientBlob Deserialize(const char *data, ui32 size); + static void CheckBlob(const TKey& key, const TString& blob); }; static constexpr const ui32 MAX_BLOB_SIZE = 8_MB; diff --git a/ydb/core/persqueue/cache_eviction.h b/ydb/core/persqueue/cache_eviction.h index 0de25e3dbd..77b71aea49 100644 --- a/ydb/core/persqueue/cache_eviction.h +++ b/ydb/core/persqueue/cache_eviction.h @@ -112,7 +112,7 @@ namespace NPQ { void Verify(const TRequestedBlob& blob) const { TKey key(TKeyPrefix::TypeData, 0, blob.Offset, blob.PartNo, blob.Count, blob.InternalPartsCount, false); Y_VERIFY(blob.Value.size() == blob.Size); - CheckBlob(key, blob.Value); + TClientBlob::CheckBlob(key, blob.Value); } }; diff --git a/ydb/core/persqueue/partition_write.cpp b/ydb/core/persqueue/partition_write.cpp index 05b335fd80..2c847ecdcb 100644 --- a/ydb/core/persqueue/partition_write.cpp +++ b/ydb/core/persqueue/partition_write.cpp @@ -1181,7 +1181,7 @@ void TPartition::AddNewWriteBlob(std::pair<TKey, ui32>& res, TEvKeyValue::TEvReq Y_VERIFY(res.second == valueD.size() || res.first.IsHead()); - CheckBlob(key, valueD); + TClientBlob::CheckBlob(key, valueD); auto write = request->Record.AddCmdWrite(); write->SetKey(key.Data(), key.Size()); |