From 85df37997ca230ffaceccc50f2c7450952aeaaf5 Mon Sep 17 00:00:00 2001 From: "wtanaka.com" Date: Mon, 17 Apr 2017 21:57:10 -1000 Subject: [PATCH] [BEAM-1992] Move Count.PerElement javadoc to a public place - [x] Make sure the PR title is formatted like: `[BEAM-] Description of pull request` - [x] Make sure tests pass via `mvn clean verify`. (Even better, enable Travis-CI on your fork and ensure the whole test matrix passes). - [x] Replace `` in the title with the actual Jira issue number, if there is one. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- --- .../org/apache/beam/sdk/transforms/Count.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Count.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Count.java index fd91430e3ce1..abda1c647d6c 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Count.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Count.java @@ -71,24 +71,17 @@ public static PTransform>, PCollection>> } /** - * Returns a {@link PerElement Count.PerElement} {@link PTransform} that counts the number of - * occurrences of each element in its input {@link PCollection}. + * Returns a {@link PTransform} that counts the number of occurrences of each element + * in its input {@link PCollection}. * - *

See {@link PerElement Count.PerElement} for more details. - */ - public static PTransform, PCollection>> perElement() { - return new PerElement<>(); - } - - /** - * {@code Count.PerElement} takes a {@code PCollection} and returns a + *

The returned {@code PTransform} takes a {@code PCollection} and returns a * {@code PCollection>} representing a map from each distinct element of the input * {@code PCollection} to the number of times that element occurs in the input. Each key in the * output {@code PCollection} is unique. * - *

This transform compares two values of type {@code T} by first encoding each element using - * the input {@code PCollection}'s {@code Coder}, then comparing the encoded bytes. Because of - * this, the input coder must be deterministic. + *

The returned transform compares two values of type {@code T} by first encoding each + * element using the input {@code PCollection}'s {@code Coder}, then comparing the encoded + * bytes. Because of this, the input coder must be deterministic. * (See {@link org.apache.beam.sdk.coders.Coder#verifyDeterministic()} for more detail). * Performing the comparison in this manner admits efficient parallel evaluation. * @@ -101,6 +94,13 @@ public static PTransform, PCollection>> perElemen * PCollection> wordCounts = * words.apply(Count.perElement()); * } + */ + public static PTransform, PCollection>> perElement() { + return new PerElement<>(); + } + + /** + * Private implementation of {@link #perElement()}. * * @param the type of the elements of the input {@code PCollection}, and the type of the keys * of the output {@code PCollection}