You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by GitBox <gi...@apache.org> on 2021/02/04 19:23:12 UTC

[GitHub] [parquet-mr] dongjoon-hyun opened a new pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

dongjoon-hyun opened a new pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865


   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [ ] My PR addresses the following [Parquet Jira](https://issues.apache.org/jira/browse/PARQUET/) issues and references them in the PR title. For example, "PARQUET-1234: My Parquet PR"
     - https://issues.apache.org/jira/browse/PARQUET-XXX
     - In case you are adding a dependency, check if the license complies with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   
   ### Tests
   
   - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   
   ### Commits
   
   - [ ] My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes how to use it.
     - All the public functions and the classes in the PR contain Javadoc that explain what it does
   


----------------------------------------------------------------
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.

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



[GitHub] [parquet-mr] dongjoon-hyun edited a comment on pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun edited a comment on pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865#issuecomment-774556210


   Not only for the issues, but also there exists improvement. FYI, Apache Spark is using ZSTD JNI directly for shuffle IO and the followings are the corresponding update and benchmark PRs.
   - https://github.com/apache/spark/pull/31453 (SPARK-34340 Support ZSTD JNI BufferPool)
   - https://github.com/apache/spark/pull/31498 (SPARK-34387 Add ZStandardBenchmark)


----------------------------------------------------------------
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.

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



[GitHub] [parquet-mr] shangxinli commented on a change in pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

Posted by GitBox <gi...@apache.org>.
shangxinli commented on a change in pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865#discussion_r592678142



##########
File path: parquet-hadoop/src/main/java/org/apache/parquet/hadoop/codec/ZstandardCodec.java
##########
@@ -91,7 +102,14 @@ public CompressionOutputStream createOutputStream(OutputStream stream, Compresso
 
   @Override
   public CompressionOutputStream createOutputStream(OutputStream stream) throws IOException {
-    return new ZstdCompressorStream(stream, conf.getInt(PARQUET_COMPRESS_ZSTD_LEVEL, DEFAULT_PARQUET_COMPRESS_ZSTD_LEVEL),
+    BufferPool pool;

Review comment:
       Thanks Dongjoon for working on this! 
   
   It is kind of late. Just a minor comment: if you can wrap the code into a method and call it in both CompressionInputStream() and CompressionOutputStream, it would avoid duplicating. Not a big deal though. 




----------------------------------------------------------------
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.

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



[GitHub] [parquet-mr] shangxinli commented on pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

Posted by GitBox <gi...@apache.org>.
shangxinli commented on pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865#issuecomment-824960946


   cc @vectorijk
   


-- 
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.

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



[GitHub] [parquet-mr] gszadovszky commented on a change in pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

Posted by GitBox <gi...@apache.org>.
gszadovszky commented on a change in pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865#discussion_r571925349



##########
File path: parquet-hadoop/README.md
##########
@@ -338,6 +338,12 @@ ParquetInputFormat to materialize records. It should be a the descendant class o
 
 ## Class: ZstandardCodec
 
+**Property:** `parquet.compression.codec.zstd.bufferPool.enabled`
+**Description:** If it is true, [RecyclingBufferPool](https://github.com/luben/zstd-jni/blob/master/src/main/java/com/github/luben/zstd/RecyclingBufferPool.java) is used.
+**Default value:** `false`
+
+---
+

Review comment:
       nit: please use double spaces at the end of the lines to enforce new-line. You can verify formatting by checking the page rendered by github: https://github.com/dongjoon-hyun/parquet-mr/tree/PARQUET-1973/parquet-hadoop#class-zstandardcodec




----------------------------------------------------------------
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.

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



[GitHub] [parquet-mr] dongjoon-hyun commented on a change in pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865#discussion_r572217749



##########
File path: parquet-hadoop/README.md
##########
@@ -338,6 +338,12 @@ ParquetInputFormat to materialize records. It should be a the descendant class o
 
 ## Class: ZstandardCodec
 
+**Property:** `parquet.compression.codec.zstd.bufferPool.enabled`
+**Description:** If it is true, [RecyclingBufferPool](https://github.com/luben/zstd-jni/blob/master/src/main/java/com/github/luben/zstd/RecyclingBufferPool.java) is used.
+**Default value:** `false`
+
+---
+

Review comment:
       Oh. Got it. Thanks!




----------------------------------------------------------------
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.

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



[GitHub] [parquet-mr] dongjoon-hyun commented on pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865#issuecomment-774556210


   Not only for the issues, but also there exists improvements. FYI, Apache Spark is using ZSTD JNI directly for shuffle IO and the followings are the corresponding update and benchmark PRs.
   - https://github.com/apache/spark/pull/31453 (SPARK-34340 Support ZSTD JNI BufferPool)
   - https://github.com/apache/spark/pull/31498 (SPARK-34387 Add ZStandardBenchmark)


----------------------------------------------------------------
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.

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



[GitHub] [parquet-mr] dongjoon-hyun commented on pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865#issuecomment-774176509


   Hi, @gszadovszky . We observed this kind of issue on Java 11 environment.
   - https://github.com/luben/zstd-jni/issues/156
   
   As I wrote in the PR description, `NoPool` is the default of `ZSTD JNI` because `Using soft/weak references could be harmful on some workloads.` (luben/zstd-jni@f7c8279)


----------------------------------------------------------------
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.

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



[GitHub] [parquet-mr] gszadovszky merged pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

Posted by GitBox <gi...@apache.org>.
gszadovszky merged pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865


   


----------------------------------------------------------------
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.

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



[GitHub] [parquet-mr] dongjoon-hyun commented on pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865#issuecomment-776081451


   Thank you for merging, @gszadovszky !


----------------------------------------------------------------
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.

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



[GitHub] [parquet-mr] dongjoon-hyun commented on pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865#issuecomment-775662535


   Thank you for approval, @gszadovszky .


----------------------------------------------------------------
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.

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



[GitHub] [parquet-mr] dongjoon-hyun commented on pull request #865: PARQUET-1973: Support ZSTD JNI BufferPool

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #865:
URL: https://github.com/apache/parquet-mr/pull/865#issuecomment-775300150


   Thank you, @gszadovszky . I added two ending spaces and checked the README. 
   <img width="877" alt="Screen Shot 2021-02-08 at 9 12 27 AM" src="https://user-images.githubusercontent.com/9700541/107256018-ccdaf780-69ed-11eb-9be6-c5925eb83210.png">
   


----------------------------------------------------------------
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.

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