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 11666200D24 for ; Mon, 9 Oct 2017 20:55:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 100BB1609B8; Mon, 9 Oct 2017 18:55:19 +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 5D0CA1609CE for ; Mon, 9 Oct 2017 20:55:18 +0200 (CEST) Received: (qmail 85360 invoked by uid 500); 9 Oct 2017 18:55:17 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 85341 invoked by uid 99); 9 Oct 2017 18:55:17 -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, 09 Oct 2017 18:55:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5CBECE8F1F; Mon, 9 Oct 2017 18:55:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jkff@apache.org To: commits@beam.apache.org Date: Mon, 09 Oct 2017 18:55:17 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] beam git commit: Add @FunctionalInterface annotation to several interfaces archived-at: Mon, 09 Oct 2017 18:55:19 -0000 Repository: beam Updated Branches: refs/heads/master 5130cab4a -> 63de41ac2 Add @FunctionalInterface annotation to several interfaces By adding the @FunctionalInterface to RowMapper, StatementPreperator and PreparedStatementSetter it's possible to write a JdbcIO source in a more concise and functional style. This change is backwards compatible with existing JdbcIO sources. Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/c1bfe00f Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/c1bfe00f Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/c1bfe00f Branch: refs/heads/master Commit: c1bfe00f77bb3726fd7d8282cd1cf41ef2ddd99e Parents: 5130cab Author: Ward Van Assche Authored: Tue Oct 3 15:13:22 2017 +0200 Committer: Eugene Kirpichov Committed: Mon Oct 9 11:42:00 2017 -0700 ---------------------------------------------------------------------- .../io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java | 3 +++ 1 file changed, 3 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/c1bfe00f/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java ---------------------------------------------------------------------- diff --git a/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java b/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java index 6ac6341..b134ec0 100644 --- a/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java +++ b/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java @@ -169,6 +169,7 @@ public class JdbcIO { * An interface used by {@link JdbcIO.Read} for converting each row of the {@link ResultSet} into * an element of the resulting {@link PCollection}. */ + @FunctionalInterface public interface RowMapper extends Serializable { T mapRow(ResultSet resultSet) throws Exception; } @@ -268,6 +269,7 @@ public class JdbcIO { * An interface used by the JdbcIO Write to set the parameters of the {@link PreparedStatement} * used to setParameters into the database. */ + @FunctionalInterface public interface StatementPreparator extends Serializable { void setParameters(PreparedStatement preparedStatement) throws Exception; } @@ -499,6 +501,7 @@ public class JdbcIO { * An interface used by the JdbcIO Write to set the parameters of the {@link PreparedStatement} * used to setParameters into the database. */ + @FunctionalInterface public interface PreparedStatementSetter extends Serializable { void setParameters(T element, PreparedStatement preparedStatement) throws Exception; }