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 7405F200B36 for ; Wed, 6 Jul 2016 19:19:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 72A35160A55; Wed, 6 Jul 2016 17:19:32 +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 9485E160A64 for ; Wed, 6 Jul 2016 19:19:31 +0200 (CEST) Received: (qmail 34974 invoked by uid 500); 6 Jul 2016 17:19:30 -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 34955 invoked by uid 99); 6 Jul 2016 17:19:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2016 17:19:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 67179C3AB9 for ; Wed, 6 Jul 2016 17:19:30 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.506 X-Spam-Level: X-Spam-Status: No, score=-4.506 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=-1.287, URI_TRY_3LD=0.001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id pKQFOVqHDtfS for ; Wed, 6 Jul 2016 17:19:29 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id 9C6FC5F4E5 for ; Wed, 6 Jul 2016 17:19:28 +0000 (UTC) Received: (qmail 34867 invoked by uid 99); 6 Jul 2016 17:19:27 -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; Wed, 06 Jul 2016 17:19:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C12EFE0B66; Wed, 6 Jul 2016 17:19:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: jbonofre@apache.org To: commits@beam.incubator.apache.org Date: Wed, 06 Jul 2016 17:19:27 -0000 Message-Id: <711e9cbcffd242319dca1efd5e610e0f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] incubator-beam git commit: [BEAM-357] Fix build on Windows archived-at: Wed, 06 Jul 2016 17:19:32 -0000 Repository: incubator-beam Updated Branches: refs/heads/master 1a5dd59f0 -> 3bb78cb8e [BEAM-357] Fix build on Windows Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/dc2532a4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/dc2532a4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/dc2532a4 Branch: refs/heads/master Commit: dc2532a40950c8903b3c12b3977756016cb378e5 Parents: 1a5dd59 Author: Romain manni-Bucau Authored: Wed Jun 22 10:42:45 2016 +0200 Committer: Jean-Baptiste Onofré Committed: Wed Jul 6 19:05:29 2016 +0200 ---------------------------------------------------------------------- .../apache/beam/runners/flink/WriteSinkITCase.java | 14 +++++++++++++- .../src/main/resources/beam/checkstyle.xml | 5 ++++- .../java/org/apache/beam/sdk/io/FileBasedSink.java | 7 ++++++- sdks/java/maven-archetypes/starter/pom.xml | 6 ++++++ 4 files changed, 29 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/dc2532a4/runners/flink/runner/src/test/java/org/apache/beam/runners/flink/WriteSinkITCase.java ---------------------------------------------------------------------- diff --git a/runners/flink/runner/src/test/java/org/apache/beam/runners/flink/WriteSinkITCase.java b/runners/flink/runner/src/test/java/org/apache/beam/runners/flink/WriteSinkITCase.java index 36d3aef..f1d9097 100644 --- a/runners/flink/runner/src/test/java/org/apache/beam/runners/flink/WriteSinkITCase.java +++ b/runners/flink/runner/src/test/java/org/apache/beam/runners/flink/WriteSinkITCase.java @@ -35,6 +35,7 @@ import org.apache.flink.core.fs.Path; import org.apache.flink.test.util.JavaProgramTestBase; import java.io.File; +import java.io.IOException; import java.io.PrintWriter; import java.net.URI; @@ -53,7 +54,7 @@ public class WriteSinkITCase extends JavaProgramTestBase { @Override protected void preSubmit() throws Exception { - resultPath = getTempDirPath("result"); + resultPath = getTempDirPath("result-" + System.nanoTime()); } @Override @@ -66,6 +67,17 @@ public class WriteSinkITCase extends JavaProgramTestBase { runProgram(resultPath); } + @Override + public void stopCluster() throws Exception { + try { + super.stopCluster(); + } catch (final IOException ioe) { + if (ioe.getMessage().startsWith("Unable to delete file")) { + // that's ok for the test itself, just the OS playing with us on cleanup phase + } + } + } + private static void runProgram(String resultPath) { Pipeline p = FlinkTestPipeline.createForBatch(); http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/dc2532a4/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml ---------------------------------------------------------------------- diff --git a/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml b/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml index 311f599..63bab09 100644 --- a/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml +++ b/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml @@ -29,7 +29,10 @@ page at http://checkstyle.sourceforge.net/config.html --> - + + + + http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/dc2532a4/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java index 02fc63a..8246148 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java @@ -38,6 +38,7 @@ import com.google.common.collect.Ordering; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; import java.io.IOException; import java.io.Serializable; import java.nio.channels.WritableByteChannel; @@ -648,7 +649,11 @@ public abstract class FileBasedSink extends Sink { private void copyOne(String source, String destination) throws IOException { try { // Copy the source file, replacing the existing destination. - Files.copy(Paths.get(source), Paths.get(destination), StandardCopyOption.REPLACE_EXISTING); + // Paths.get(x) will not work on win cause of the ":" after the drive letter + Files.copy( + new File(source).toPath(), + new File(destination).toPath(), + StandardCopyOption.REPLACE_EXISTING); } catch (NoSuchFileException e) { LOG.debug("{} does not exist.", source); // Suppress exception if file does not exist. http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/dc2532a4/sdks/java/maven-archetypes/starter/pom.xml ---------------------------------------------------------------------- diff --git a/sdks/java/maven-archetypes/starter/pom.xml b/sdks/java/maven-archetypes/starter/pom.xml index 5b6cb2a..7c16e82 100644 --- a/sdks/java/maven-archetypes/starter/pom.xml +++ b/sdks/java/maven-archetypes/starter/pom.xml @@ -60,6 +60,12 @@ integration-test + + + true +