aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/codecs/zstd_dict_codec.h
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/codecs/zstd_dict_codec.h
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/codecs/zstd_dict_codec.h')
-rw-r--r--library/cpp/codecs/zstd_dict_codec.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/library/cpp/codecs/zstd_dict_codec.h b/library/cpp/codecs/zstd_dict_codec.h
new file mode 100644
index 0000000000..59c1ad6c60
--- /dev/null
+++ b/library/cpp/codecs/zstd_dict_codec.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include "codecs.h"
+
+#include <util/generic/ptr.h>
+
+namespace NCodecs {
+ // benchmarks are here: https://st.yandex-team.ru/SEARCH-1655
+
+ class TZStdDictCodec: public ICodec {
+ class TImpl;
+ TIntrusivePtr<TImpl> Impl;
+
+ public:
+ explicit TZStdDictCodec(ui32 comprLevel = 1);
+ ~TZStdDictCodec() override;
+
+ static TStringBuf MyName() {
+ return "zstd08d";
+ }
+
+ TString GetName() const override;
+
+ ui8 Encode(TStringBuf in, TBuffer& out) const override;
+
+ void Decode(TStringBuf in, TBuffer& out) const override;
+
+ static TVector<TString> ListCompressionNames();
+ static int ParseCompressionName(TStringBuf);
+
+ protected:
+ void DoLearn(ISequenceReader& in) override;
+ bool DoTryToLearn(ISequenceReader& in) final;
+ void Save(IOutputStream* out) const override;
+ void Load(IInputStream* in) override;
+ };
+
+}