diff options
author | max42 <max42@yandex-team.com> | 2023-06-30 11:13:34 +0300 |
---|---|---|
committer | max42 <max42@yandex-team.com> | 2023-06-30 11:13:34 +0300 |
commit | 3e1899838408bbad47622007aa382bc8a2b01f87 (patch) | |
tree | 0f21c1e6add187ddb6c3ccc048a7d640ce03fb87 /library/cpp/erasure/public.h | |
parent | 5463eb3f5e72a86f858a3d27c886470a724ede34 (diff) | |
download | ydb-3e1899838408bbad47622007aa382bc8a2b01f87.tar.gz |
Revert "YT-19324: move YT provider to ydb/library/yql"
This reverts commit ca272f12fdd0e8d5c3e957fc87939148f1caaf72, reversing
changes made to 49f8acfc8b0b5c0071b804423bcf53fda26c7c12.
Diffstat (limited to 'library/cpp/erasure/public.h')
-rw-r--r-- | library/cpp/erasure/public.h | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/library/cpp/erasure/public.h b/library/cpp/erasure/public.h deleted file mode 100644 index d5cf01297b1..00000000000 --- a/library/cpp/erasure/public.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include <util/generic/buffer.h> -#include <util/generic/yexception.h> -#include <util/memory/blob.h> -#include <util/string/cast.h> -#include <util/system/src_root.h> - -#include <vector> - -#include <bitset> - -namespace NErasure { - -//! The maximum total number of blocks our erasure codec can handle. -static constexpr int MaxTotalPartCount = 16; - -//! Max word size to use. `w` in jerasure notation -static constexpr int MaxWordSize = 8; - -//! Max threshold to generate bitmask for CanRepair indices for LRC encoding. -static constexpr int BitmaskOptimizationThreshold = 22; - -//! A vector type for holding block indexes. -using TPartIndexList = std::vector<int>; - -//! Each bit corresponds to a possible block index. -using TPartIndexSet = std::bitset<MaxTotalPartCount>; - -template <class TBlobType> -struct ICodec; - -struct TDefaultCodecTraits { - using TBlobType = TBlob; - using TMutableBlobType = TBlob; - using TBufferType = TBuffer; - - static inline TMutableBlobType AllocateBlob(size_t size) { - TBufferType buffer(size); - buffer.Resize(size); - // The buffer is cleared after this call so no use after free. - return TBlob::FromBuffer(buffer); - } - - // AllocateBuffer must fill the memory with 0. - static inline TBufferType AllocateBuffer(size_t size) { - TBufferType buffer(size); - buffer.Fill(0, size); - return buffer; - } - - static inline TBlobType FromBufferToBlob(TBufferType&& blob) { - return TBlobType::FromBuffer(blob); - } -}; - -} // namespace NErasure |