You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ro...@apache.org on 2016/09/22 23:19:01 UTC
[2/3] incubator-beam git commit: Better documentation for
CompressionTypes.
Better documentation for CompressionTypes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/04d84c99
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/04d84c99
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/04d84c99
Branch: refs/heads/python-sdk
Commit: 04d84c996a14b557647a4c85703a29fbeaaa0db6
Parents: 9565b2c
Author: Gus Katsiapis <ka...@katsiapis-linux.mtv.corp.google.com>
Authored: Thu Sep 22 10:25:45 2016 -0700
Committer: Robert Bradshaw <ro...@google.com>
Committed: Thu Sep 22 16:18:28 2016 -0700
----------------------------------------------------------------------
sdks/python/apache_beam/io/fileio.py | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/04d84c99/sdks/python/apache_beam/io/fileio.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/io/fileio.py b/sdks/python/apache_beam/io/fileio.py
index d640d50..6c254c7 100644
--- a/sdks/python/apache_beam/io/fileio.py
+++ b/sdks/python/apache_beam/io/fileio.py
@@ -60,10 +60,23 @@ class _CompressionType(object):
class CompressionTypes(object):
"""Enum-like class representing known compression types."""
- AUTO = _CompressionType(1) # Detect compression based on filename extension.
- GZIP = _CompressionType(2) # gzip compression (deflate with gzip headers).
- ZLIB = _CompressionType(3) # zlib compression (deflate with zlib headers).
- UNCOMPRESSED = _CompressionType(4) # Uncompressed (i.e., may be split).
+
+ # Detect compression based on filename extension.
+ #
+ # The following extensions are currently recognized by auto-detection:
+ # .gz (implies GZIP as described below)
+ # .z (implies ZLIB as described below).
+ # Any non-recognized extension implies UNCOMPRESSED as described below.
+ AUTO = _CompressionType(1)
+
+ # GZIP compression (deflate with GZIP headers).
+ GZIP = _CompressionType(2)
+
+ # ZLIB compression (deflate with ZLIB headers).
+ ZLIB = _CompressionType(3)
+
+ # Uncompressed (i.e., may be split).
+ UNCOMPRESSED = _CompressionType(4)
# TODO: Remove this backwards-compatibility soon.
NO_COMPRESSION = _CompressionType(4) # Deprecated. Use UNCOMPRESSED instead.