I impemented a potential solution to "[BEAM-64] General decompression
registry". It still needs a bit more attention with some of the finer
details, e.g. better error handling, better javadocs, adding unit tests.

However, before I spend more time on it, I would like a review of the
general design.

https://github.com/apache/incubator-beam/compare/master...fkautz:beam-64?expand=1

Design:

I attempted to implement an approach that would require no code changes to
the users. There is an SDK interface change, but it should be backwards
compatible with existing code.

TextIO.withCompression() is now capable of receiving a generic compressor
operator which includes all of the enums from before (AUTO, UNCOMPRESSED,
GZIP, BZIP2) but now can also receive a user or library implemented
compressor.

CompressionType also receives a new getRegistry() which allows the user to
customize the behavior of AUTO. It allows the user to add, replace or
remove registered compressors as necessary.

Here's a short list of changes:

* Create a new CompressorOperator, compatible with Java 8 lambda
* CompressionType enum now implements CompressorType
* withCompression now takes a CompressorOperator
* Compression wrappers implementations moved from in-line code to
CompressionType enum
* Compression registry created
* AUTO now supports compressors registered with the registry

Can someone review the design and give me feedback? If the design looks
good, I'll move forward on implementing tests, better exception error
messages, and improve the javadocs.

Thanks,
Frederick

Reply via email to