You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "wgtmac (via GitHub)" <gi...@apache.org> on 2023/04/04 01:22:18 UTC

[GitHub] [arrow] wgtmac commented on a diff in pull request #34873: GH-34749 : [Java] Make Zstd compression level configurable

wgtmac commented on code in PR #34873:
URL: https://github.com/apache/arrow/pull/34873#discussion_r1156616671


##########
java/compression/src/main/java/org/apache/arrow/compression/CommonsCompressionFactory.java:
##########
@@ -27,15 +27,22 @@
  */
 public class CommonsCompressionFactory implements CompressionCodec.Factory {
 
-  public static final CommonsCompressionFactory INSTANCE = new CommonsCompressionFactory();
+  private int compressionLevel;
+
+  public CommonsCompressionFactory(int compressionLevel) {
+    this.compressionLevel = compressionLevel;
+  }
+
+  @Deprecated
+  public static final CommonsCompressionFactory INSTANCE = new CommonsCompressionFactory(3);
 
   @Override
   public CompressionCodec createCodec(CompressionUtil.CodecType codecType) {

Review Comment:
   Is it better to extend `createCodec` to add an `Optional<int> level`? The downside of the current implementation is that we need to create separate instances for different levels.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org