Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4E845200BCA for ; Mon, 21 Nov 2016 20:35:35 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4D0C7160B1C; Mon, 21 Nov 2016 19:35:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9FB2D160AEF for ; Mon, 21 Nov 2016 20:35:34 +0100 (CET) Received: (qmail 54214 invoked by uid 500); 21 Nov 2016 19:35:33 -0000 Mailing-List: contact commits-help@beam.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.incubator.apache.org Delivered-To: mailing list commits@beam.incubator.apache.org Received: (qmail 54204 invoked by uid 99); 21 Nov 2016 19:35:33 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Nov 2016 19:35:33 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 790F718051E for ; Mon, 21 Nov 2016 19:35:33 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 9EuqxKx8gh2B for ; Mon, 21 Nov 2016 19:35:31 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id A0C575FAD2 for ; Mon, 21 Nov 2016 19:35:30 +0000 (UTC) Received: (qmail 54177 invoked by uid 99); 21 Nov 2016 19:35:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Nov 2016 19:35:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8FB78EC227; Mon, 21 Nov 2016 19:35:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lcwik@apache.org To: commits@beam.incubator.apache.org Date: Mon, 21 Nov 2016 19:35:30 -0000 Message-Id: <0c373cfaf41f463c8d74b0d554a19efb@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/4] incubator-beam git commit: Handling the 'collision' case for UIDs and also augmenting comments. archived-at: Mon, 21 Nov 2016 19:35:35 -0000 Handling the 'collision' case for UIDs and also augmenting comments. Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/9f9c9865 Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/9f9c9865 Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/9f9c9865 Branch: refs/heads/python-sdk Commit: 9f9c986500f769ebeb0baaf32f1a86334a36eec5 Parents: e85f67a Author: Gus Katsiapis Authored: Sat Nov 19 15:22:47 2016 -0800 Committer: Luke Cwik Committed: Mon Nov 21 11:29:07 2016 -0800 ---------------------------------------------------------------------- sdks/python/apache_beam/io/fileio.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/9f9c9865/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 1dcd622..cb7f25c 100644 --- a/sdks/python/apache_beam/io/fileio.py +++ b/sdks/python/apache_beam/io/fileio.py @@ -862,7 +862,11 @@ class FileSink(iobase.Sink): def open_writer(self, init_result, uid): # A proper suffix is needed for AUTO compression detection. - suffix = os.path.basename(self.file_path_prefix) + self.file_name_suffix + # We also ensure there will be no collisions with uid and a + # (possibly unsharded) file_path_prefix and a (possibly empty) + # file_name_suffix. + suffix = ( + '.' + os.path.basename(self.file_path_prefix) + self.file_name_suffix) return FileSinkWriter(self, os.path.join(init_result, uid) + suffix) def finalize_write(self, init_result, writer_results):