You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ke...@apache.org on 2017/01/10 17:09:49 UTC
[1/2] beam git commit: [BEAM-1248] Add varargs withSideInputs to
Combine
Repository: beam
Updated Branches:
refs/heads/master b81bd25e1 -> fe7fc298f
[BEAM-1248] Add varargs withSideInputs to Combine
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/8f7450d9
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/8f7450d9
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/8f7450d9
Branch: refs/heads/master
Commit: 8f7450d900effa521a72f4ddc400b69df81c2133
Parents: b81bd25
Author: Kai Jiang <ji...@gmail.com>
Authored: Mon Jan 9 16:40:06 2017 -0800
Committer: Kenneth Knowles <kl...@google.com>
Committed: Tue Jan 10 09:08:42 2017 -0800
----------------------------------------------------------------------
.../org/apache/beam/sdk/transforms/Combine.java | 21 ++++++++++++++++++++
1 file changed, 21 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/beam/blob/8f7450d9/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Combine.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Combine.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Combine.java
index 98a7bec..51c5e71 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Combine.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Combine.java
@@ -27,6 +27,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
@@ -1401,6 +1402,14 @@ public class Combine {
* Returns a {@link PTransform} identical to this, but with the specified side inputs to use
* in {@link CombineFnWithContext}.
*/
+ public Globally<InputT, OutputT> withSideInputs(PCollectionView<?>... sideInputs) {
+ return withSideInputs(Arrays.asList(sideInputs));
+ }
+
+ /**
+ * Returns a {@link PTransform} identical to this, but with the specified side inputs to use
+ * in {@link CombineFnWithContext}.
+ */
public Globally<InputT, OutputT> withSideInputs(
Iterable<? extends PCollectionView<?>> sideInputs) {
checkState(fn instanceof RequiresContextInternal);
@@ -1799,6 +1808,14 @@ public class Combine {
* Returns a {@link PTransform} identical to this, but with the specified side inputs to use
* in {@link KeyedCombineFnWithContext}.
*/
+ public PerKey<K, InputT, OutputT> withSideInputs(PCollectionView<?>... sideInputs) {
+ return withSideInputs(Arrays.asList(sideInputs));
+ }
+
+ /**
+ * Returns a {@link PTransform} identical to this, but with the specified side inputs to use
+ * in {@link KeyedCombineFnWithContext}.
+ */
public PerKey<K, InputT, OutputT> withSideInputs(
Iterable<? extends PCollectionView<?>> sideInputs) {
checkState(fn instanceof RequiresContextInternal);
@@ -2367,6 +2384,10 @@ public class Combine {
this.sideInputs = sideInputs;
}
+ public GroupedValues<K, InputT, OutputT> withSideInputs(PCollectionView<?>... sideInputs) {
+ return withSideInputs(Arrays.asList(sideInputs));
+ }
+
public GroupedValues<K, InputT, OutputT> withSideInputs(
Iterable<? extends PCollectionView<?>> sideInputs) {
return new GroupedValues<>(fn, fnDisplayData, ImmutableList.copyOf(sideInputs));
[2/2] beam git commit: This closes #1755: Combine with side inputs
API should match ParDo
Posted by ke...@apache.org.
This closes #1755: Combine with side inputs API should match ParDo
[BEAM-1248] Add varargs withSideInputs to Combine
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/fe7fc298
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/fe7fc298
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/fe7fc298
Branch: refs/heads/master
Commit: fe7fc298f77f23535c09c450ce0714f4690b7e8a
Parents: b81bd25 8f7450d
Author: Kenneth Knowles <kl...@google.com>
Authored: Tue Jan 10 09:09:19 2017 -0800
Committer: Kenneth Knowles <kl...@google.com>
Committed: Tue Jan 10 09:09:19 2017 -0800
----------------------------------------------------------------------
.../org/apache/beam/sdk/transforms/Combine.java | 21 ++++++++++++++++++++
1 file changed, 21 insertions(+)
----------------------------------------------------------------------