beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tg...@apache.org
Subject [2/4] beam git commit: Remove SingletonCombine
Date Fri, 03 Mar 2017 22:59:27 GMT
Remove SingletonCombine

It is unused with the update to Streaming View Overrides.


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/079966ca
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/079966ca
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/079966ca

Branch: refs/heads/master
Commit: 079966cad99442c63e0f3147a6361139bd601c8c
Parents: 7b94c99
Author: Thomas Groh <tgroh@google.com>
Authored: Fri Mar 3 10:57:50 2017 -0800
Committer: Thomas Groh <tgroh@google.com>
Committed: Fri Mar 3 14:59:12 2017 -0800

----------------------------------------------------------------------
 .../dataflow/StreamingViewOverrides.java        | 29 --------------------
 1 file changed, 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/079966ca/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/StreamingViewOverrides.java
----------------------------------------------------------------------
diff --git a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/StreamingViewOverrides.java
b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/StreamingViewOverrides.java
index 8e005cf..5f0cb26 100644
--- a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/StreamingViewOverrides.java
+++ b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/StreamingViewOverrides.java
@@ -66,35 +66,6 @@ class StreamingViewOverrides {
     }
   }
 
-  private static class SingletonCombine<T> extends Combine.BinaryCombineFn<T>
{
-    private boolean hasDefaultValue;
-    private T defaultValue;
-
-    SingletonCombine(boolean hasDefaultValue, T defaultValue) {
-      this.hasDefaultValue = hasDefaultValue;
-      this.defaultValue = defaultValue;
-    }
-
-    @Override
-    public T apply(T left, T right) {
-      throw new IllegalArgumentException(
-          "PCollection with more than one element "
-              + "accessed as a singleton view. Consider using Combine.globally().asSingleton()
to "
-              + "combine the PCollection into a single value");
-    }
-
-    @Override
-    public T identity() {
-      if (hasDefaultValue) {
-        return defaultValue;
-      } else {
-        throw new IllegalArgumentException(
-            "Empty PCollection accessed as a singleton view. "
-                + "Consider setting withDefault to provide a default value");
-      }
-    }
-  }
-
   /**
    * Combiner that combines {@code T}s into a single {@code List<T>} containing all
inputs.
    *


Mime
View raw message