Skip to content

Commit

Permalink
MINOR: Update zstd and use classes with no finalizers (apache#10120)
Browse files Browse the repository at this point in the history
The updated version includes a few optimizations that benefit us:
* Classes with no finalizers (opt-in) that have better GC behavior
* `InputStream.skip()` implementation that uses cached buffers
* Minor buffer recycler optimizations (used for OutputStream only)

Full diff:
luben/zstd-jni@v1.4.8-2...v1.4.8-4

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
  • Loading branch information
ijuma committed Feb 13, 2021
1 parent 1d4f69b commit 70a36bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ private static class SnappyConstructors {

private static class ZstdConstructors {
// It's ok to reference `BufferPool` since it doesn't load any native libraries
static final MethodHandle INPUT = findConstructor("com.github.luben.zstd.ZstdInputStream",
static final MethodHandle INPUT = findConstructor("com.github.luben.zstd.ZstdInputStreamNoFinalizer",
MethodType.methodType(void.class, InputStream.class, BufferPool.class));
static final MethodHandle OUTPUT = findConstructor("com.github.luben.zstd.ZstdOutputStream",
static final MethodHandle OUTPUT = findConstructor("com.github.luben.zstd.ZstdOutputStreamNoFinalizer",
MethodType.methodType(void.class, OutputStream.class, BufferPool.class));
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ versions += [
testRetryPlugin: "1.2.0",
zinc: "1.3.5",
zookeeper: "3.5.9",
zstd: "1.4.8-2"
zstd: "1.4.8-4"
]
libs += [
activation: "javax.activation:activation:$versions.activation",
Expand Down

0 comments on commit 70a36bd

Please sign in to comment.