Conversation
|
Hi @normanmaurer @chrisvest
|
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
666e4c4 to
6822cd9
Compare
There was a problem hiding this comment.
please implement this yourself so we dont need the extra dependency
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
bb488b0 to
16fd37a
Compare
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
codec/src/test/java/io/netty/handler/codec/compression/ZstdIntegrationTest.java
Outdated
Show resolved
Hide resolved
16fd37a to
123ed34
Compare
|
@skyguard1 after checking the code in more detail I think there are multiple things that needs to be addressed. Give me a few days to dig into it. |
|
I didn't forget about this one... Its on my todo list for next week. |
|
@normanmaurer |
|
Is there any news on this? We really could use it. |
|
@abergmeier unfortunately no... I am swamped atm with other stuff |
|
Looking forward to this landing! |
|
Any update on this? |
|
Unfortunately no and I don't know when I will have time |
Signed-off-by: xingrufei <qhdxssm@qq.com>
This reverts commit 87531c7
Signed-off-by: xingrufei <qhdxssm@qq.com>
Signed-off-by: xingrufei <qhdxssm@qq.com>
47f0d49 to
010bcb7
Compare
|
@skyguard1 PTAL... sorry it took me so long |
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
|
@luben PTAL again |
luben
left a comment
There was a problem hiding this comment.
LGTM. Thanks for making the suggested change.
|
@luben one question... luben/zstd-jni#302 ... Is it somehow possible to limit the max block size so we are sure |
|
Ok this is complete now.. will merge once the build did pass once |
|
See luben/zstd-jni#302 for limit the block size |
|
@chrisvest can you have a look as well |
chrisvest
left a comment
There was a problem hiding this comment.
Spotted a potential simplification, but otherwise looks good.
codec/src/main/java/io/netty/handler/codec/compression/ZstdDecoder.java
Outdated
Show resolved
Hide resolved
Signed-off-by: xingrufei <qhdxssm@qq.com>
codec/src/test/java/io/netty/handler/codec/compression/ZstdDecoderTest.java
Outdated
Show resolved
Hide resolved
codec/src/test/java/io/netty/handler/codec/compression/ZstdDecoderTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: xingrufei <qhdxssm@qq.com>
…oder.java Co-authored-by: Chris Vest <mr.chrisvest@gmail.com>
Signed-off-by: xingrufei <qhdxssm@qq.com>
Signed-off-by: xingrufei <qhdxssm@qq.com>
Signed-off-by: xingrufei <qhdxssm@qq.com>
Signed-off-by: xingrufei <qhdxssm@qq.com>
| @Override | ||
| public void handlerAdded(ChannelHandlerContext ctx) throws Exception { | ||
| super.handlerAdded(ctx); | ||
| zstdIs = new ZstdInputStreamNoFinalizer(inputStream); |
There was a problem hiding this comment.
the current usage will allocate internal byte[] for each instantiation which will contribute to memory pressure, but there is a option to use a BufferPool: https://github.com/luben/zstd-jni/blob/20014d19a91a1b04e4e198ac1cb85b5acb1c1142/src/main/java/com/github/luben/zstd/ZstdInputStreamNoFinalizer.java#L62
RecyclingBufferPool.INSTANCE is a stock implementation, but it may be possible to create an implementation which is backed by the netty's PooledAllocator if that is desired.
There was a problem hiding this comment.
here is skeletal BufferPool implementation which is backed by Netty's allocator
public class ZstdBufferPool implements BufferPool {
// the constructor seems to use only a single buffer
private final List<ByteBuf> byteBufs = new ArrayList<>(1);
@Override
public ByteBuffer get(int capacity) {
ByteBuf byteBuf = alloc.heapBuffer(capacity);
byteBufs.add(byteBuf);
return byteBuf.nioBuffer();
}
@Override
public void release(ByteBuffer buffer) {
// pass, instead release these buffers after we close stream
}
// call this after the stream is closed
public void releaseAll(){
for(ByteBuf byteBuf: byteBufs){
bufBufs.release();
}
}
}There was a problem hiding this comment.
actually nevermind, the implementation does not appear to support ByteBuffers which are slices of larger arrays, so I guess RecyclingBufferPool.INSTANCE is the only option.
There was a problem hiding this comment.
I think we should pull it in as it is ... we can do a follow for improvements later
|
Thanks to all... This was merged :) |
Motivation: Zstandard(https://facebook.github.io/zstd/) is a high performance, high compression ratio compression algorithm,This pr is to add netty support for the zstandard algorithm,The implementation of zstandard algorithm relies on zstd-jni (https://github.com/luben/zstd-jni), which is an openSource third-party library,Apache Kafka is also using this library for message compression processing. This is the copy of #10422 Modification: Add ZstdDecoder and test case. Result: netty supports ZSTD with zstdDecoder --------- Signed-off-by: xingrufei <qhdxssm@qq.com> Co-authored-by: xingrufei <xingrufei@yl.com> Co-authored-by: Norman Maurer <norman_maurer@apple.com> Co-authored-by: Chris Vest <mr.chrisvest@gmail.com>
Motivation: Zstandard(https://facebook.github.io/zstd/) is a high performance, high compression ratio compression algorithm,This pr is to add netty support for the zstandard algorithm,The implementation of zstandard algorithm relies on zstd-jni (https://github.com/luben/zstd-jni), which is an openSource third-party library,Apache Kafka is also using this library for message compression processing. This is the copy of #10422 Modification: Add ZstdDecoder and test case. Result: netty supports ZSTD with zstdDecoder Signed-off-by: xingrufei <qhdxssm@qq.com> Co-authored-by: skyguard1 <qhdxssm@qq.com> Co-authored-by: xingrufei <xingrufei@yl.com> Co-authored-by: Chris Vest <mr.chrisvest@gmail.com>
Motivation:
Zstandard(https://facebook.github.io/zstd/) is a high performance, high compression ratio compression algorithm,This pr is to add netty support for the zstandard algorithm,The implementation of zstandard algorithm relies on zstd-jni (https://github.com/luben/zstd-jni), which is an openSource third-party library,Apache Kafka is also using this library for message compression processing.
This is the copy of #10422
Modification:
Add ZstdDecoder and test case.
Result:
netty supports ZSTD with zstdDecoder