steveniemitz opened a new pull request, #17783:
URL: https://github.com/apache/beam/pull/17783

   This PR adds a new interface, `ShuffleCompressor`, which allows users to 
plug in compression for values just before they're written to shuffle.
   
   The interface is a little odd, we originally had exposed it as simply 
wrapping Input/Output streams.  However, this interface is much more efficient:
   - In the compression path, the implementor can use the RandomAccessData as 
both a buffer pool (using scratch space at the end for example) and also 
compress the data "in place" if possible.  Additionally, many compression 
algorithms can operate more efficiently on a fixed-sized buffer rather than 
having to deal with an unknown amount of input data.
   - In the decompression path, using ByteBuffer allows efficiently slicing the 
input and output buffers as well.  Ideally I think this interface would use 
ByteString as well, but didn't want to expose the shaded protobuf library in 
the public API.
   
   Additionally this also changes most places in the shuffle IO path to use 
ByteString rather than byte[].  This allows efficiently "slicing" the buffer 
received from the shuffle reader, removing a significant number of byte[] 
copies.
   
   Internally we have an implementation of ShuffleCompressor that uses zstd, 
and we see a significant benefit from using it.  For example, at level 3 (the 
default), a simple `read -> reshuffle -> do something` pipeline sees a 50% 
reduction in data shuffled for our representative test datasets.
   
   R: @lukecwik 
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us 
incorporate your contribution quickly and easily:
   
    - [x] [**Choose 
reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and 
mention them in a comment (`R: @username`).
    - [x] Format the pull request title like `[BEAM-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA 
issue, if applicable. This will automatically link the pull request to the 
issue.
    - [ ] Update `CHANGES.md` with noteworthy changes.
    - [x] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   See the [Contributor Guide](https://beam.apache.org/contribute) for more 
tips on [how to make review process 
smoother](https://beam.apache.org/contribute/#make-reviewers-job-easier).
   
   To check the build health, please visit 
[https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
   
   GitHub Actions Tests Status (on master branch)
   
------------------------------------------------------------------------------------------------
   [![Build python source distribution and 
wheels](https://github.com/apache/beam/workflows/Build%20python%20source%20distribution%20and%20wheels/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python 
tests](https://github.com/apache/beam/workflows/Python%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java 
tests](https://github.com/apache/beam/workflows/Java%20Tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   
   See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more 
information about GitHub Actions CI.
   


-- 
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-unsubscr...@beam.apache.org

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

Reply via email to