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/codecs/static | |
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/codecs/static')
-rw-r--r-- | library/cpp/codecs/static/builder.cpp | 6 | ||||
-rw-r--r-- | library/cpp/codecs/static/builder.h | 12 | ||||
-rw-r--r-- | library/cpp/codecs/static/common.h | 4 | ||||
-rw-r--r-- | library/cpp/codecs/static/static.cpp | 6 | ||||
-rw-r--r-- | library/cpp/codecs/static/static.h | 8 | ||||
-rw-r--r-- | library/cpp/codecs/static/tools/common/ct_common.cpp | 10 | ||||
-rw-r--r-- | library/cpp/codecs/static/tools/common/ct_common.h | 10 | ||||
-rw-r--r-- | library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp | 4 | ||||
-rw-r--r-- | library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp | 6 | ||||
-rw-r--r-- | library/cpp/codecs/static/ut/builder_ut.cpp | 8 |
10 files changed, 37 insertions, 37 deletions
diff --git a/library/cpp/codecs/static/builder.cpp b/library/cpp/codecs/static/builder.cpp index 93e34a3edb..3df19eeedf 100644 --- a/library/cpp/codecs/static/builder.cpp +++ b/library/cpp/codecs/static/builder.cpp @@ -9,7 +9,7 @@ #include <util/string/subst.h> namespace NCodecs { - TStaticCodecInfo BuildStaticCodec(const TVector<TString>& trainingData, const TCodecBuildInfo& info) { + TStaticCodecInfo BuildStaticCodec(const TVector<TString>& trainingData, const TCodecBuildInfo& info) { TStaticCodecInfo result; TCodecPtr codec = ICodec::GetInstance(info.CodecName); Y_ENSURE_EX(codec, TCodecException() << "empty codec is not allowed"); @@ -31,8 +31,8 @@ namespace NCodecs { return result; } - TString GetStandardFileName(const TStaticCodecInfo& info) { - TString cName = info.GetDebugInfo().GetCodecName(); + TString GetStandardFileName(const TStaticCodecInfo& info) { + TString cName = info.GetDebugInfo().GetCodecName(); SubstGlobal(cName, ':', '.'); return TStringBuilder() << cName << "." << info.GetDebugInfo().GetTimestamp() << ".codec_info"; } diff --git a/library/cpp/codecs/static/builder.h b/library/cpp/codecs/static/builder.h index d7533be4d5..f179d77861 100644 --- a/library/cpp/codecs/static/builder.h +++ b/library/cpp/codecs/static/builder.h @@ -5,25 +5,25 @@ #include <library/cpp/svnversion/svnversion.h> #include <util/datetime/base.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/generic/vector.h> #include <util/string/builder.h> namespace NCodecs { struct TCodecBuildInfo { // optimal values from SEARCH-1655 - TString CodecName = "solar-8k-a:zstd08d-1"; + TString CodecName = "solar-8k-a:zstd08d-1"; float SampleSizeMultiplier = 1; // debug info: time_t Timestamp = TInstant::Now().TimeT(); - TString RevisionInfo = (TStringBuilder() << "r" << ToString(GetProgramSvnRevision())); - TString TrainingSetComment; // a human comment on the training data + TString RevisionInfo = (TStringBuilder() << "r" << ToString(GetProgramSvnRevision())); + TString TrainingSetComment; // a human comment on the training data TString TrainingSetResId; // sandbox resid of the training set }; - TStaticCodecInfo BuildStaticCodec(const TVector<TString>& trainingData, const TCodecBuildInfo&); + TStaticCodecInfo BuildStaticCodec(const TVector<TString>& trainingData, const TCodecBuildInfo&); - TString GetStandardFileName(const TStaticCodecInfo&); + TString GetStandardFileName(const TStaticCodecInfo&); } diff --git a/library/cpp/codecs/static/common.h b/library/cpp/codecs/static/common.h index 211de2a27d..588975b8de 100644 --- a/library/cpp/codecs/static/common.h +++ b/library/cpp/codecs/static/common.h @@ -12,10 +12,10 @@ namespace NCodecs { } template <class T> - TString HexWriteScalar(T t) { + TString HexWriteScalar(T t) { static_assert(std::is_scalar<T>::value, "scalars only"); t = LittleToBig(t); - TString res = HexEncode(&t, sizeof(t)); + TString res = HexEncode(&t, sizeof(t)); res.to_lower(); return res; } diff --git a/library/cpp/codecs/static/static.cpp b/library/cpp/codecs/static/static.cpp index 44a07dd73a..2c84c90d9c 100644 --- a/library/cpp/codecs/static/static.cpp +++ b/library/cpp/codecs/static/static.cpp @@ -50,7 +50,7 @@ namespace NCodecs { return result; } - TString SaveCodecInfoToString(const TStaticCodecInfo& info) { + TString SaveCodecInfoToString(const TStaticCodecInfo& info) { TStringStream s; SaveCodecInfoToStream(s, info); return s.Str(); @@ -61,7 +61,7 @@ namespace NCodecs { return LoadCodecInfoFromStream(m); } - TString FormatCodecInfo(const TStaticCodecInfo& ci) { + TString FormatCodecInfo(const TStaticCodecInfo& ci) { TStringBuilder s; s << "codec name: " << ci.GetDebugInfo().GetCodecName() << Endl; s << "codec hash: " << HexWriteScalar(ci.GetDebugInfo().GetStoredCodecHash()) << Endl; @@ -77,7 +77,7 @@ namespace NCodecs { return s; } - TString LoadStringFromArchive(const ui8* begin, size_t size) { + TString LoadStringFromArchive(const ui8* begin, size_t size) { TArchiveReader ar(TBlob::NoCopy(begin, size)); Y_VERIFY(ar.Count() == 1, "invalid number of entries"); auto blob = ar.ObjectBlobByKey(ar.KeyByIndex(0)); diff --git a/library/cpp/codecs/static/static.h b/library/cpp/codecs/static/static.h index c1eaed2a74..9a2fa5a1d7 100644 --- a/library/cpp/codecs/static/static.h +++ b/library/cpp/codecs/static/static.h @@ -3,7 +3,7 @@ #include <library/cpp/codecs/codecs.h> #include <util/generic/strbuf.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/stream/output.h> namespace NCodecs { @@ -15,13 +15,13 @@ namespace NCodecs { TStaticCodecInfo LoadCodecInfoFromString(TStringBuf data); - TString LoadStringFromArchive(const ui8* begin, size_t size); + TString LoadStringFromArchive(const ui8* begin, size_t size); TCodecConstPtr RestoreCodecFromArchive(const ui8* begin, size_t size); // save - TString SaveCodecInfoToString(const TStaticCodecInfo&); + TString SaveCodecInfoToString(const TStaticCodecInfo&); void SaveCodecInfoToStream(IOutputStream& out, const TStaticCodecInfo&); @@ -29,6 +29,6 @@ namespace NCodecs { TStaticCodecInfo LoadCodecInfoFromStream(IInputStream& in); - TString FormatCodecInfo(const TStaticCodecInfo&); + TString FormatCodecInfo(const TStaticCodecInfo&); } diff --git a/library/cpp/codecs/static/tools/common/ct_common.cpp b/library/cpp/codecs/static/tools/common/ct_common.cpp index fe77691280..ab4a2fac3f 100644 --- a/library/cpp/codecs/static/tools/common/ct_common.cpp +++ b/library/cpp/codecs/static/tools/common/ct_common.cpp @@ -9,7 +9,7 @@ #include <util/system/hp_timer.h> namespace NCodecs { - TString TComprStats::Format(const TStaticCodecInfo& info, bool checkMode) const { + TString TComprStats::Format(const TStaticCodecInfo& info, bool checkMode) const { TStringBuilder s; s << "raw size/item: " << RawSizePerRecord() << Endl; s << "enc.size/item: " << EncSizePerRecord() << Endl; @@ -26,7 +26,7 @@ namespace NCodecs { return s; } - TComprStats TestCodec(const ICodec& c, const TVector<TString>& input) { + TComprStats TestCodec(const ICodec& c, const TVector<TString>& input) { TComprStats stats; TBuffer encodeBuffer; @@ -51,10 +51,10 @@ namespace NCodecs { return stats; } - void ParseBlob(TVector<TString>& result, EDataStreamFormat fmt, const TBlob& blob) { + void ParseBlob(TVector<TString>& result, EDataStreamFormat fmt, const TBlob& blob) { TStringBuf bin(blob.AsCharPtr(), blob.Size()); TStringBuf line; - TString buffer; + TString buffer; while (bin.ReadLine(line)) { if (DSF_BASE64_LF == fmt) { Base64Decode(line, buffer); @@ -67,7 +67,7 @@ namespace NCodecs { } } - TBlob GetInputBlob(const TString& dataFile) { + TBlob GetInputBlob(const TString& dataFile) { return dataFile && dataFile != "-" ? TBlob::FromFile(dataFile) : TBlob::FromStream(Cin); } diff --git a/library/cpp/codecs/static/tools/common/ct_common.h b/library/cpp/codecs/static/tools/common/ct_common.h index 9d3dcbda93..a66c476c3d 100644 --- a/library/cpp/codecs/static/tools/common/ct_common.h +++ b/library/cpp/codecs/static/tools/common/ct_common.h @@ -1,6 +1,6 @@ #pragma once -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/generic/vector.h> #include <util/memory/blob.h> #include <cmath> @@ -57,10 +57,10 @@ namespace NCodecs { return PerRecord((1 - compr) * RawSize); } - TString Format(const TStaticCodecInfo&, bool checkMode) const; + TString Format(const TStaticCodecInfo&, bool checkMode) const; }; - TComprStats TestCodec(const ICodec&, const TVector<TString>& data); + TComprStats TestCodec(const ICodec&, const TVector<TString>& data); enum EDataStreamFormat { DSF_NONE, @@ -68,8 +68,8 @@ namespace NCodecs { DSF_BASE64_LF /* "base64" */, }; - void ParseBlob(TVector<TString>&, EDataStreamFormat, const TBlob&); + void ParseBlob(TVector<TString>&, EDataStreamFormat, const TBlob&); - TBlob GetInputBlob(const TString& dataFile); + TBlob GetInputBlob(const TString& dataFile); } diff --git a/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp b/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp index 9c8d568d82..1775a07303 100644 --- a/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp +++ b/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp @@ -14,7 +14,7 @@ int main(int argc, char** argv) { NCodecs::TCodecPtr codecPtr; NCodecs::EDataStreamFormat fmt = NCodecs::DSF_NONE; - TString codecFile; + TString codecFile; bool testCompression = false; auto opts = NLastGetopt::TOpts::Default(); @@ -50,7 +50,7 @@ int main(int argc, char** argv) { Cout << "Reading testing set data ... " << Flush; - TVector<TString> allData; + TVector<TString> allData; for (const auto& freeArg : res.GetFreeArgs()) { NCodecs::ParseBlob(allData, fmt, NCodecs::GetInputBlob(freeArg)); } diff --git a/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp b/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp index 45fdb5c5fe..c5b4f0fcde 100644 --- a/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp +++ b/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp @@ -44,7 +44,7 @@ int main(int argc, char** argv) { NLastGetopt::TOptsParseResult res(&opts, argc, argv); Cout << "Reading training set data ... " << Flush; - TVector<TString> allData; + TVector<TString> allData; for (const auto& freeArg : res.GetFreeArgs()) { NCodecs::ParseBlob(allData, fmt, NCodecs::GetInputBlob(freeArg)); } @@ -61,7 +61,7 @@ int main(int argc, char** argv) { auto codec = NCodecs::BuildStaticCodec(allData, info); Cout << "Done" << Endl; - TString codecName = NCodecs::GetStandardFileName(codec); + TString codecName = NCodecs::GetStandardFileName(codec); NCodecs::TCodecPtr codecPtr = NCodecs::ICodec::RestoreFromString(codec.GetStoredCodec()); Cout << "Testing compression ... " << Flush; @@ -74,7 +74,7 @@ int main(int argc, char** argv) { Cout << "Saving as " << codecName << " ... " << Flush; { - TUnbufferedFileOutput fout{codecName}; + TUnbufferedFileOutput fout{codecName}; NCodecs::SaveCodecInfoToStream(fout, codec); fout.Finish(); } diff --git a/library/cpp/codecs/static/ut/builder_ut.cpp b/library/cpp/codecs/static/ut/builder_ut.cpp index b47c279ed1..e4b207d132 100644 --- a/library/cpp/codecs/static/ut/builder_ut.cpp +++ b/library/cpp/codecs/static/ut/builder_ut.cpp @@ -9,16 +9,16 @@ class TStaticCodecInfoBuilderTest: public NUnitTest::TTestBase { UNIT_TEST_SUITE_END(); private: - TVector<TString> PrepareData() { - TVector<TString> data; + TVector<TString> PrepareData() { + TVector<TString> data; for (ui32 i = 'a'; i <= 'z'; ++i) { - data.push_back(TString(1, (char)i)); + data.push_back(TString(1, (char)i)); } return data; } void TestBuild() { - TVector<TString> data; + TVector<TString> data; NCodecs::TCodecBuildInfo info; info.CodecName = "huffman"; info.SampleSizeMultiplier = 2; |