Repository: beam Updated Branches: refs/heads/master 49aeef92a -> 1e2f90c17
[BEAM-1223][Followup] Reduced visibility for Sum,Min,Max,Mean combine Fns. Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/ab797be6 Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/ab797be6 Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/ab797be6 Branch: refs/heads/master Commit: ab797be69d122a693b678b8d365177780fd4582e Parents: 49aeef9 Author: Stas Levin <[email protected]> Authored: Wed Jan 4 09:23:55 2017 +0200 Committer: Luke Cwik <[email protected]> Committed: Wed Jan 4 16:10:46 2017 -0800 ---------------------------------------------------------------------- .../org/apache/beam/sdk/transforms/Max.java | 27 +++----------------- .../org/apache/beam/sdk/transforms/Mean.java | 12 +-------- .../org/apache/beam/sdk/transforms/Min.java | 27 +++----------------- .../org/apache/beam/sdk/transforms/Sum.java | 21 +++------------ 4 files changed, 12 insertions(+), 75 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/ab797be6/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Max.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Max.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Max.java index f6460b6..91851bc 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Max.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Max.java @@ -212,14 +212,7 @@ public class Max { ///////////////////////////////////////////////////////////////////////////// - /** - * A {@code CombineFn} that computes the maximum of a collection of elements of type {@code T} - * using an arbitrary {@link Comparator}, useful as an argument to {@link Combine#globally} or - * {@link Combine#perKey}. - * - * @param <T> the type of the values being compared - */ - public static class MaxFn<T> extends BinaryCombineFn<T> { + private static class MaxFn<T> extends BinaryCombineFn<T> { private final T identity; private final Comparator<? super T> comparator; @@ -248,11 +241,7 @@ public class Max { } } - /** - * A {@code CombineFn} that computes the maximum of a collection of {@code Integer}s, useful as an - * argument to {@link Combine#globally} or {@link Combine#perKey}. - */ - public static class MaxIntegerFn extends Combine.BinaryCombineIntegerFn { + private static class MaxIntegerFn extends Combine.BinaryCombineIntegerFn { @Override public int apply(int left, int right) { @@ -265,11 +254,7 @@ public class Max { } } - /** - * A {@code CombineFn} that computes the maximum of a collection of {@code Long}s, useful as an - * argument to {@link Combine#globally} or {@link Combine#perKey}. - */ - public static class MaxLongFn extends Combine.BinaryCombineLongFn { + private static class MaxLongFn extends Combine.BinaryCombineLongFn { @Override public long apply(long left, long right) { @@ -282,11 +267,7 @@ public class Max { } } - /** - * A {@code CombineFn} that computes the maximum of a collection of {@code Double}s, useful as an - * argument to {@link Combine#globally} or {@link Combine#perKey}. - */ - public static class MaxDoubleFn extends Combine.BinaryCombineDoubleFn { + private static class MaxDoubleFn extends Combine.BinaryCombineDoubleFn { @Override public double apply(double left, double right) { http://git-wip-us.apache.org/repos/asf/beam/blob/ab797be6/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Mean.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Mean.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Mean.java index 17dbe6c..5e7c003 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Mean.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Mean.java @@ -101,17 +101,7 @@ public class Mean { ///////////////////////////////////////////////////////////////////////////// - /** - * A {@code Combine.CombineFn} that computes the arithmetic mean - * (a.k.a. average) of an {@code Iterable} of numbers of type - * {@code N}, useful as an argument to {@link Combine#globally} or - * {@link Combine#perKey}. - * - * <p>Returns {@code Double.NaN} if combining zero elements. - * - * @param <NumT> the type of the {@code Number}s being combined - */ - public static class MeanFn<NumT extends Number> + private static class MeanFn<NumT extends Number> extends Combine.AccumulatingCombineFn<NumT, CountSum<NumT>, Double> { /** * Constructs a combining function that computes the mean over http://git-wip-us.apache.org/repos/asf/beam/blob/ab797be6/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Min.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Min.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Min.java index 47d831c..109f4e5 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Min.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Min.java @@ -212,14 +212,7 @@ public class Min { ///////////////////////////////////////////////////////////////////////////// - /** - * A {@code CombineFn} that computes the maximum of a collection of elements of type {@code T} - * using an arbitrary {@link Comparator}, useful as an argument to {@link Combine#globally} or - * {@link Combine#perKey}. - * - * @param <T> the type of the values being compared - */ - public static class MinFn<T> extends BinaryCombineFn<T> { + private static class MinFn<T> extends BinaryCombineFn<T> { private final T identity; private final Comparator<? super T> comparator; @@ -248,11 +241,7 @@ public class Min { } } - /** - * A {@code CombineFn} that computes the minimum of a collection of {@code Integer}s, useful as an - * argument to {@link Combine#globally} or {@link Combine#perKey}. - */ - public static class MinIntegerFn extends Combine.BinaryCombineIntegerFn { + private static class MinIntegerFn extends Combine.BinaryCombineIntegerFn { @Override public int apply(int left, int right) { @@ -265,11 +254,7 @@ public class Min { } } - /** - * A {@code CombineFn} that computes the minimum of a collection of {@code Long}s, useful as an - * argument to {@link Combine#globally} or {@link Combine#perKey}. - */ - public static class MinLongFn extends Combine.BinaryCombineLongFn { + private static class MinLongFn extends Combine.BinaryCombineLongFn { @Override public long apply(long left, long right) { @@ -282,11 +267,7 @@ public class Min { } } - /** - * A {@code CombineFn} that computes the minimum of a collection of {@code Double}s, useful as an - * argument to {@link Combine#globally} or {@link Combine#perKey}. - */ - public static class MinDoubleFn extends Combine.BinaryCombineDoubleFn { + private static class MinDoubleFn extends Combine.BinaryCombineDoubleFn { @Override public double apply(double left, double right) { http://git-wip-us.apache.org/repos/asf/beam/blob/ab797be6/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Sum.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Sum.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Sum.java index 5044732..ccade4d 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Sum.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Sum.java @@ -140,12 +140,7 @@ public class Sum { ///////////////////////////////////////////////////////////////////////////// - /** - * A {@code SerializableFunction} that computes the sum of an - * {@code Iterable} of {@code Integer}s, useful as an argument to - * {@link Combine#globally} or {@link Combine#perKey}. - */ - public static class SumIntegerFn extends Combine.BinaryCombineIntegerFn { + private static class SumIntegerFn extends Combine.BinaryCombineIntegerFn { @Override public int apply(int a, int b) { @@ -158,12 +153,7 @@ public class Sum { } } - /** - * A {@code SerializableFunction} that computes the sum of an - * {@code Iterable} of {@code Long}s, useful as an argument to - * {@link Combine#globally} or {@link Combine#perKey}. - */ - public static class SumLongFn extends Combine.BinaryCombineLongFn { + private static class SumLongFn extends Combine.BinaryCombineLongFn { @Override public long apply(long a, long b) { @@ -176,12 +166,7 @@ public class Sum { } } - /** - * A {@code SerializableFunction} that computes the sum of an - * {@code Iterable} of {@code Double}s, useful as an argument to - * {@link Combine#globally} or {@link Combine#perKey}. - */ - public static class SumDoubleFn extends Combine.BinaryCombineDoubleFn { + private static class SumDoubleFn extends Combine.BinaryCombineDoubleFn { @Override public double apply(double a, double b) {
