compression: add zstd compressor and decompressor#1
compression: add zstd compressor and decompressor#1rainingmaster wants to merge 9 commits intomainfrom
Conversation
rojkov
left a comment
There was a problem hiding this comment.
This looks great overall. I've got one high level question.
source/extensions/compression/zstd/decompressor/zstd_decompressor_impl.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
A little confuse here, has_set_dictionary_ is set to true, then hasSetDictionary return false?
There was a problem hiding this comment.
Hi @liuqiming-intel. Thanks for your review. has_set_dictionary_ is a tag to record is dictionary has try to set in this context(should be by request). So if has_set_dictionary_ is false, we will return false, and set it as true. So next round it will be true.
There was a problem hiding this comment.
I think these constants should be updated to constexpr absl::string_view.
There was a problem hiding this comment.
Hi @zhxie , it is true absl::string_view is better than std::string, but here is relate to CompressorLibraryFactoryBase, should we update it when we upgrade all compressor module?
There was a problem hiding this comment.
Since we have already used const string&, then it is Ok to not touch it.
There was a problem hiding this comment.
Should this setting be bounded with lte and gte?
There was a problem hiding this comment.
I think zstd is a little bit different with other compression algorithm, even it could be a negative number. as discussion here:
Setting a level does not automatically set all other compression parameters to default. Setting this will however eventually dynamically impact the compression parameters which have not been manually set.
And as my new test case, both 0 and 10000 are work for this parameter, so in fact I have no idea how to limit it...
source/extensions/compression/zstd/compressor/zstd_compressor_impl.cc
Outdated
Show resolved
Hide resolved
test/extensions/compression/zstd/compressor/zstd_compressor_impl_test.cc
Outdated
Show resolved
Hide resolved
test/extensions/compression/zstd/decompressor/zstd_decompressor_impl_test.cc
Outdated
Show resolved
Hide resolved
docs/root/configuration/http/http_filters/compressor_filter.rst
Outdated
Show resolved
Hide resolved
docs/root/configuration/http/http_filters/decompressor_filter.rst
Outdated
Show resolved
Hide resolved
|
Raise a new PR in official git repo: envoyproxy#20434 |
2f58b23 to
d55e0eb
Compare
d55e0eb to
89a4642
Compare
6397906 to
f57666b
Compare
Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
Commit Message: compression: add zstd compressor and decompressor
Additional Description: Like envoyproxy#12998, add new zstd(alson name as Zstandard) compression extensions in addition to gzip, brotli.
Risk Level: Low, add
contextfor createCompressorFactoryFromProtoTyped in exist code.Testing: uni tests, manual tests with curl.
Docs Changes: updated docs for compression and decompression HTTP filters to refer the new available encoder/decoder.
Release Notes: TODO
The PR adds a new dependency on https://github.com/facebook/zstd. Here's the current criteria answers: