diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/blockcodecs/core | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) | |
download | ydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/blockcodecs/core')
-rw-r--r-- | library/cpp/blockcodecs/core/codecs.cpp | 10 | ||||
-rw-r--r-- | library/cpp/blockcodecs/core/codecs.h | 20 | ||||
-rw-r--r-- | library/cpp/blockcodecs/core/common.h | 4 | ||||
-rw-r--r-- | library/cpp/blockcodecs/core/stream.cpp | 4 | ||||
-rw-r--r-- | library/cpp/blockcodecs/core/stream.h | 4 |
5 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/blockcodecs/core/codecs.cpp b/library/cpp/blockcodecs/core/codecs.cpp index 21506e812b..072da37087 100644 --- a/library/cpp/blockcodecs/core/codecs.cpp +++ b/library/cpp/blockcodecs/core/codecs.cpp @@ -61,8 +61,8 @@ namespace { TDeque<TString> Tmp; TNullCodec Null; - TVector<TCodecPtr> Codecs; - typedef THashMap<TStringBuf, ICodec*> TRegistry; + TVector<TCodecPtr> Codecs; + typedef THashMap<TStringBuf, ICodec*> TRegistry; TRegistry Registry; // SEARCH-8344: Global decompressed size limiter (to prevent remote DoS) @@ -82,7 +82,7 @@ TCodecList NBlockCodecs::ListAllCodecs() { return ret; } -TString NBlockCodecs::ListAllCodecsAsString() { +TString NBlockCodecs::ListAllCodecsAsString() { return JoinSeq(TStringBuf(","), ListAllCodecs()); } @@ -127,7 +127,7 @@ void ICodec::Decode(const TData& in, TBuffer& out) const { out.Resize(Decompress(in, out.Data())); } -void ICodec::Encode(const TData& in, TString& out) const { +void ICodec::Encode(const TData& in, TString& out) const { const size_t maxLen = MaxCompressedLength(in); out.ReserveAndResize(maxLen); @@ -136,7 +136,7 @@ void ICodec::Encode(const TData& in, TString& out) const { out.resize(actualLen); } -void ICodec::Decode(const TData& in, TString& out) const { +void ICodec::Decode(const TData& in, TString& out) const { const size_t maxLen = GetDecompressedLength(in); out.ReserveAndResize(maxLen); diff --git a/library/cpp/blockcodecs/core/codecs.h b/library/cpp/blockcodecs/core/codecs.h index 9c93c00274..878678d5c7 100644 --- a/library/cpp/blockcodecs/core/codecs.h +++ b/library/cpp/blockcodecs/core/codecs.h @@ -2,7 +2,7 @@ #include <util/generic/buffer.h> #include <util/generic/strbuf.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/generic/typetraits.h> #include <util/generic/vector.h> #include <util/generic/yexception.h> @@ -45,25 +45,25 @@ namespace NBlockCodecs { virtual size_t Compress(const TData& in, void* out) const = 0; virtual size_t Decompress(const TData& in, void* out) const = 0; - virtual TStringBuf Name() const noexcept = 0; + virtual TStringBuf Name() const noexcept = 0; // some useful helpers void Encode(const TData& in, TBuffer& out) const; void Decode(const TData& in, TBuffer& out) const; - void Encode(const TData& in, TString& out) const; - void Decode(const TData& in, TString& out) const; + void Encode(const TData& in, TString& out) const; + void Decode(const TData& in, TString& out) const; - inline TString Encode(const TData& in) const { - TString out; + inline TString Encode(const TData& in) const { + TString out; Encode(in, out); return out; } - inline TString Decode(const TData& in) const { - TString out; + inline TString Decode(const TData& in) const { + TString out; Decode(in, out); @@ -78,9 +78,9 @@ namespace NBlockCodecs { const ICodec* Codec(const TStringBuf& name); // some aux methods - typedef TVector<TStringBuf> TCodecList; + typedef TVector<TStringBuf> TCodecList; TCodecList ListAllCodecs(); - TString ListAllCodecsAsString(); + TString ListAllCodecsAsString(); // SEARCH-8344: Get the size of max possible decompressed block size_t GetMaxPossibleDecompressedLength(); diff --git a/library/cpp/blockcodecs/core/common.h b/library/cpp/blockcodecs/core/common.h index f05df4d334..8e1dabb593 100644 --- a/library/cpp/blockcodecs/core/common.h +++ b/library/cpp/blockcodecs/core/common.h @@ -55,7 +55,7 @@ namespace NBlockCodecs { return in.size(); } - TStringBuf Name() const noexcept override { + TStringBuf Name() const noexcept override { return TStringBuf("null"); } }; @@ -98,7 +98,7 @@ namespace NBlockCodecs { return len; } - inline const T* Base() const noexcept { + inline const T* Base() const noexcept { return static_cast<const T*>(this); } }; diff --git a/library/cpp/blockcodecs/core/stream.cpp b/library/cpp/blockcodecs/core/stream.cpp index 4f7db3c32b..856400b5a1 100644 --- a/library/cpp/blockcodecs/core/stream.cpp +++ b/library/cpp/blockcodecs/core/stream.cpp @@ -51,7 +51,7 @@ namespace { ythrow yexception() << "can not find codec by id " << id; } - typedef THashMap<TCodecID, const ICodec*> TByID; + typedef THashMap<TCodecID, const ICodec*> TByID; TByID ByID; }; @@ -74,7 +74,7 @@ TCodedOutput::TCodedOutput(IOutputStream* out, const ICodec* c, size_t bufLen) } } -TCodedOutput::~TCodedOutput() { +TCodedOutput::~TCodedOutput() { try { Finish(); } catch (...) { diff --git a/library/cpp/blockcodecs/core/stream.h b/library/cpp/blockcodecs/core/stream.h index fd44ef88f2..92ccd10333 100644 --- a/library/cpp/blockcodecs/core/stream.h +++ b/library/cpp/blockcodecs/core/stream.h @@ -12,7 +12,7 @@ namespace NBlockCodecs { class TCodedOutput: public IOutputStream { public: TCodedOutput(IOutputStream* out, const ICodec* c, size_t bufLen); - ~TCodedOutput() override; + ~TCodedOutput() override; private: void DoWrite(const void* buf, size_t len) override; @@ -33,7 +33,7 @@ namespace NBlockCodecs { TDecodedInput(IInputStream* in); TDecodedInput(IInputStream* in, const ICodec* codec); - ~TDecodedInput() override; + ~TDecodedInput() override; private: size_t DoUnboundedNext(const void** ptr) override; |