You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2017/01/03 22:36:41 UTC
[6/7] beam git commit: [BEAM-1223] Added the missing javadocs.
[BEAM-1223] Added the missing javadocs.
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/3e16e325
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/3e16e325
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/3e16e325
Branch: refs/heads/master
Commit: 3e16e325a6d88ac7b21bb9f79357b14dd280becd
Parents: 0697b05
Author: Stas Levin <st...@gmail.com>
Authored: Tue Jan 3 21:36:12 2017 +0200
Committer: Luke Cwik <lc...@google.com>
Committed: Tue Jan 3 14:29:06 2017 -0800
----------------------------------------------------------------------
.../java/org/apache/beam/sdk/transforms/Max.java | 19 +++++++++++++++++++
.../org/apache/beam/sdk/transforms/Mean.java | 10 ++++++++++
.../java/org/apache/beam/sdk/transforms/Min.java | 19 +++++++++++++++++++
.../java/org/apache/beam/sdk/transforms/Sum.java | 15 +++++++++++++++
4 files changed, 63 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/beam/blob/3e16e325/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 69aaaf2..f6460b6 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,6 +212,13 @@ 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 final T identity;
@@ -241,6 +248,10 @@ 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 {
@Override
@@ -254,6 +265,10 @@ 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 {
@Override
@@ -267,6 +282,10 @@ 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 {
@Override
http://git-wip-us.apache.org/repos/asf/beam/blob/3e16e325/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 d650f07..17dbe6c 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,6 +101,16 @@ 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>
extends Combine.AccumulatingCombineFn<NumT, CountSum<NumT>, Double> {
/**
http://git-wip-us.apache.org/repos/asf/beam/blob/3e16e325/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 ce3b64a..47d831c 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,6 +212,13 @@ 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 final T identity;
@@ -241,6 +248,10 @@ 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 {
@Override
@@ -254,6 +265,10 @@ 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 {
@Override
@@ -267,6 +282,10 @@ 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 {
@Override
http://git-wip-us.apache.org/repos/asf/beam/blob/3e16e325/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 4e0f680..5044732 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,6 +140,11 @@ 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 {
@Override
@@ -153,6 +158,11 @@ 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 {
@Override
@@ -166,6 +176,11 @@ 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 {
@Override