[
https://issues.apache.org/jira/browse/BEAM-55?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15534021#comment-15534021
]
ASF GitHub Bot commented on BEAM-55:
------------------------------------
GitHub user jeffkpayne opened a pull request:
https://github.com/apache/incubator-beam/pull/1027
[BEAM-55] Add abstract support for writing compressed/decorated/transformed
files
Essentially, this adds customizable file-based output support through
DecoratedFileSink and concrete Gzip file-based output support through
WriterOutputGzipDecoratorFactory. I realize that the test coverage might be a
little light for Apache Beam standards and have no problem expanding that if
needed.
The DecoratedFileSink class provides a hook for decorating/transforming
data output at the WritableByteChannel/OutputStream level to enable things like
Gzip compression during shard file writes. I included a concrete
implementation, WriterOutputGzipDecoratorFactory, of the hook interface, which
enables Gzip output, and is currently in use by us at Bombora. My thinking was
that a hook at this level would enable any file level transformation that could
be done via wrapping an OutputStream (as opposed to field or record level
handled elsewhere in the existing API).
P.S. Not sure how large the PR needs to be to require an ICLA...
- [x] Make sure the PR title is formatted like:
`[BEAM-<Jira issue #>] Description of pull request`
- [x] Make sure tests pass via `mvn clean verify`. (Even better, enable
Travis-CI on your fork and ensure the whole test matrix passes).
- [x] Replace `<Jira issue #>` in the title with the actual Jira issue
number, if there is one.
- [?] If this contribution is large, please file an Apache
[Individual Contributor License
Agreement](https://www.apache.org/licenses/icla.txt).
Thanks!
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bomboradata/incubator-beam
decorated-file-sink-gzip-support
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-beam/pull/1027.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1027
----
commit 373ddd7b0884ce5d7702ebfb2288eea350e0d517
Author: Jeffrey Scott Keone Payne <[email protected]>
Date: 2016-09-29T19:23:44Z
[BEAM-55] Add customizable file-based output support through
DecoratedFileSink and concrete Gzip file-based output support through
WriterOutputGzipDecoratorFactory
----
> Allow users to compress FileBasedSink output files
> --------------------------------------------------
>
> Key: BEAM-55
> URL: https://issues.apache.org/jira/browse/BEAM-55
> Project: Beam
> Issue Type: New Feature
> Components: sdk-java-core
> Reporter: Daniel Halperin
> Priority: Minor
>
> FileBasedSink (also TextIO.Write, AvroIO.Write, etc). does not have an option
> for compressing its output.
> In general, we discourage compression because it limits or blocks scalably
> reading from a file in parallel. However, users may want it -- so we should
> support the option (with appropriate warnings).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)