You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ex...@apache.org on 2024/04/04 19:43:27 UTC

(nifi) branch main updated: NIFI-13002 Restored zstd Compression Level in CompressContent

This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 7f5680d1fe NIFI-13002 Restored zstd Compression Level in CompressContent
7f5680d1fe is described below

commit 7f5680d1fed374666ee92fd9e43c9d660507c467
Author: Joseph Witt <jo...@apache.org>
AuthorDate: Thu Apr 4 11:19:54 2024 -0700

    NIFI-13002 Restored zstd Compression Level in CompressContent
    
    This closes #8604
    
    Signed-off-by: David Handermann <ex...@apache.org>
---
 .../main/java/org/apache/nifi/processors/standard/CompressContent.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CompressContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CompressContent.java
index a910a4f875..1d95aebb9d 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CompressContent.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CompressContent.java
@@ -349,7 +349,8 @@ public class CompressContent extends AbstractProcessor {
                                     compressionOut = new CompressorStreamFactory().createCompressorOutputStream(compressionFormat.toLowerCase(), bufferedOut);
                                     break;
                                 case COMPRESSION_FORMAT_ZSTD:
-                                    compressionOut = new ZstdCompressorOutputStream(bufferedOut);
+                                    final int zstdCompressionLevel = context.getProperty(COMPRESSION_LEVEL).asInteger() * 2;
+                                    compressionOut = new ZstdCompressorOutputStream(bufferedOut, zstdCompressionLevel);
                                     mimeTypeRef.set("application/zstd");
                                     break;
                                 case COMPRESSION_FORMAT_BROTLI: {