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 C15BD200C5D for ; Fri, 24 Mar 2017 02:21:37 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C002E160B84; Fri, 24 Mar 2017 01:21:37 +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 12E84160B83 for ; Fri, 24 Mar 2017 02:21:36 +0100 (CET) Received: (qmail 17538 invoked by uid 500); 24 Mar 2017 01:21:31 -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 17522 invoked by uid 99); 24 Mar 2017 01:21:31 -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; Fri, 24 Mar 2017 01:21:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 48A09E0893; Fri, 24 Mar 2017 01:21:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tgroh@apache.org To: commits@beam.apache.org Date: Fri, 24 Mar 2017 01:21:32 -0000 Message-Id: <8c89d5a19cb24a3f8cd72c26e67c07e4@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] beam git commit: Make Canonical ViewFns Public archived-at: Fri, 24 Mar 2017 01:21:37 -0000 Make Canonical ViewFns Public Mark all of the ViewFns as both deprecated and experimental. These fns will all be removed once Runners have multimap support, and are not suitable for users to use explicitly. Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/ee1b835e Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/ee1b835e Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/ee1b835e Branch: refs/heads/master Commit: ee1b835eebdcdc1db3cc7270ca5181ff90b2fde7 Parents: 87c8ef0 Author: Thomas Groh Authored: Thu Mar 23 15:23:40 2017 -0700 Committer: Thomas Groh Committed: Thu Mar 23 18:21:19 2017 -0700 ---------------------------------------------------------------------- .../apache/beam/sdk/util/PCollectionViews.java | 42 ++++++++++++++++---- 1 file changed, 34 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/ee1b835e/sdks/java/core/src/main/java/org/apache/beam/sdk/util/PCollectionViews.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/PCollectionViews.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/PCollectionViews.java index 83ccae8..848d8b3 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/PCollectionViews.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/PCollectionViews.java @@ -32,6 +32,8 @@ import java.util.NoSuchElementException; import java.util.Objects; import javax.annotation.Nullable; import org.apache.beam.sdk.Pipeline; +import org.apache.beam.sdk.annotations.Experimental; +import org.apache.beam.sdk.annotations.Experimental.Kind; import org.apache.beam.sdk.coders.Coder; import org.apache.beam.sdk.coders.IterableCoder; import org.apache.beam.sdk.transforms.ViewFn; @@ -228,8 +230,13 @@ public class PCollectionViews { *

For internal use only. * *

Instantiate via {@link PCollectionViews#singletonView}. + * + * @deprecated Beam views are migrating off of {@code Iterable>} as a primitive + * view type. */ - private static class SingletonViewFn extends ViewFn>, T> { + @Deprecated + @Experimental(Kind.CORE_RUNNERS_ONLY) + public static class SingletonViewFn extends ViewFn>, T> { @Nullable private byte[] encodedDefaultValue; @Nullable private transient T defaultValue; @Nullable private Coder valueCoder; @@ -292,8 +299,13 @@ public class PCollectionViews { *

For internal use only. * *

Instantiate via {@link PCollectionViews#iterableView}. + * + * @deprecated Beam views are migrating off of {@code Iterable>} as a primitive + * view type. */ - private static class IterableViewFn + @Deprecated + @Experimental(Kind.CORE_RUNNERS_ONLY) + public static class IterableViewFn extends ViewFn>, Iterable> { @Override @@ -315,8 +327,13 @@ public class PCollectionViews { *

For internal use only. * *

Instantiate via {@link PCollectionViews#listView}. + * + * @deprecated Beam views are migrating off of {@code Iterable>} as a primitive + * view type. */ - private static class ListViewFn extends ViewFn>, List> { + @Deprecated + @Experimental(Kind.CORE_RUNNERS_ONLY) + public static class ListViewFn extends ViewFn>, List> { @Override public List apply(Iterable> contents) { return ImmutableList.copyOf( @@ -333,8 +350,13 @@ public class PCollectionViews { /** * Implementation of conversion {@code Iterable>>} * to {@code Map>}. + * + * @deprecated Beam views are migrating off of {@code Iterable>} as a primitive + * view type. */ - private static class MultimapViewFn + @Deprecated + @Experimental(Kind.CORE_RUNNERS_ONLY) + public static class MultimapViewFn extends ViewFn>>, Map>> { @Override @@ -352,11 +374,15 @@ public class PCollectionViews { } /** - * Implementation of conversion {@code Iterable>} with one value per key - * to {@code Map}. + * Implementation of conversion {@code Iterable>} with one value per key to + * {@code Map}. + * + * @deprecated Beam views are migrating off of {@code Iterable>} as a primitive + * view type. */ - private static class MapViewFn - extends ViewFn>>, Map> { + @Deprecated + @Experimental(Kind.CORE_RUNNERS_ONLY) + public static class MapViewFn extends ViewFn>>, Map> { /** * Input iterable must actually be {@code Iterable>>}. */