beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [1/2] incubator-beam git commit: Remove getOrCreate pattern from DoFnSignatures and DoFnInvokers
Date Fri, 14 Oct 2016 17:35:02 GMT
Repository: incubator-beam
Updated Branches:
  refs/heads/master 2584ebeb8 -> 87c5839dc


Remove getOrCreate pattern from DoFnSignatures and DoFnInvokers

This excessive verbosity is also an abstraction violation. It
is an implementation detail how the value is produced.


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

Branch: refs/heads/master
Commit: 546a572d21822e38a16f0b26ef15a60fb163d2da
Parents: 49f9444
Author: Kenneth Knowles <klk@google.com>
Authored: Fri Oct 14 08:48:49 2016 -0700
Committer: Kenneth Knowles <klk@google.com>
Committed: Fri Oct 14 08:57:39 2016 -0700

----------------------------------------------------------------------
 .../beam/runners/core/SplittableParDo.java      |  2 +-
 .../runners/direct/ParDoOverrideFactory.java    |  2 +-
 .../beam/sdk/transforms/DoFnAdapters.java       |  2 +-
 .../org/apache/beam/sdk/transforms/ParDo.java   |  4 +--
 .../sdk/transforms/reflect/DoFnInvokers.java    | 12 ++++---
 .../sdk/transforms/reflect/DoFnSignatures.java  |  6 ++--
 .../DoFnSignaturesProcessElementTest.java       | 12 +++----
 .../DoFnSignaturesSplittableDoFnTest.java       | 34 ++++++++++----------
 .../transforms/reflect/DoFnSignaturesTest.java  | 16 ++++-----
 9 files changed, 46 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/546a572d/runners/core-java/src/main/java/org/apache/beam/runners/core/SplittableParDo.java
----------------------------------------------------------------------
diff --git a/runners/core-java/src/main/java/org/apache/beam/runners/core/SplittableParDo.java
b/runners/core-java/src/main/java/org/apache/beam/runners/core/SplittableParDo.java
index 7645149..33d0ab7 100644
--- a/runners/core-java/src/main/java/org/apache/beam/runners/core/SplittableParDo.java
+++ b/runners/core-java/src/main/java/org/apache/beam/runners/core/SplittableParDo.java
@@ -92,7 +92,7 @@ public class SplittableParDo<
   public SplittableParDo(DoFn<InputT, OutputT> fn) {
     checkNotNull(fn, "fn must not be null");
     this.fn = fn;
-    this.signature = DoFnSignatures.INSTANCE.getOrParseSignature(fn.getClass());
+    this.signature = DoFnSignatures.INSTANCE.getSignature(fn.getClass());
     checkArgument(signature.processElement().isSplittable(), "fn must be a splittable DoFn");
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/546a572d/runners/direct-java/src/main/java/org/apache/beam/runners/direct/ParDoOverrideFactory.java
----------------------------------------------------------------------
diff --git a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/ParDoOverrideFactory.java
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/ParDoOverrideFactory.java
index a57735c..0881868 100644
--- a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/ParDoOverrideFactory.java
+++ b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/ParDoOverrideFactory.java
@@ -46,7 +46,7 @@ class ParDoOverrideFactory implements PTransformOverrideFactory {
       // This is an OldDoFn, hence not splittable.
       return transform;
     }
-    DoFnSignature signature = DoFnSignatures.INSTANCE.getOrParseSignature(fn.getClass());
+    DoFnSignature signature = DoFnSignatures.INSTANCE.getSignature(fn.getClass());
     if (!signature.processElement().isSplittable()) {
       return transform;
     }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/546a572d/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFnAdapters.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFnAdapters.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFnAdapters.java
index f671a67..12d4824 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFnAdapters.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFnAdapters.java
@@ -61,7 +61,7 @@ public class DoFnAdapters {
   /** Creates an {@link OldDoFn} that delegates to the {@link DoFn}. */
   @SuppressWarnings({"unchecked", "rawtypes"})
   public static <InputT, OutputT> OldDoFn<InputT, OutputT> toOldDoFn(DoFn<InputT,
OutputT> fn) {
-    DoFnSignature signature = DoFnSignatures.INSTANCE.getOrParseSignature((Class) fn.getClass());
+    DoFnSignature signature = DoFnSignatures.INSTANCE.getSignature((Class) fn.getClass());
     if (signature.processElement().usesSingleWindow()) {
       return new WindowDoFnAdapter<>(fn);
     } else {

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/546a572d/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ParDo.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ParDo.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ParDo.java
index c5a80c6..4d34c88 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ParDo.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ParDo.java
@@ -551,7 +551,7 @@ public class ParDo {
    * correctly and that its features can be supported.
    */
   private static <InputT, OutputT> void validate(DoFn<InputT, OutputT> fn) {
-    DoFnSignature signature = DoFnSignatures.INSTANCE.getOrParseSignature((Class) fn.getClass());
+    DoFnSignature signature = DoFnSignatures.INSTANCE.getSignature((Class) fn.getClass());
 
     // To be removed when the features are complete and runners have their own adequate
     // rejection logic
@@ -1040,7 +1040,7 @@ public class ParDo {
       return false;
     }
     return DoFnSignatures.INSTANCE
-        .getOrParseSignature(fn.getClass())
+        .getSignature(fn.getClass())
         .processElement()
         .isSplittable();
   }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/546a572d/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvokers.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvokers.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvokers.java
index fd057c3..8eb6145 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvokers.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvokers.java
@@ -203,7 +203,7 @@ public class DoFnInvokers {
   public <InputT, OutputT> DoFnInvoker<InputT, OutputT> newByteBuddyInvoker(
       DoFn<InputT, OutputT> fn) {
     return newByteBuddyInvoker(
-        DoFnSignatures.INSTANCE.getOrParseSignature((Class) fn.getClass()), fn);
+        DoFnSignatures.INSTANCE.getSignature((Class) fn.getClass()), fn);
   }
 
   /** @return the {@link DoFnInvoker} for the given {@link DoFn}. */
@@ -218,7 +218,7 @@ public class DoFnInvokers {
       @SuppressWarnings("unchecked")
       DoFnInvoker<InputT, OutputT> invoker =
           (DoFnInvoker<InputT, OutputT>)
-              getOrGenerateByteBuddyInvokerConstructor(signature).newInstance(fn);
+              getByteBuddyInvokerConstructor(signature).newInstance(fn);
       return invoker;
     } catch (InstantiationException
         | IllegalAccessException
@@ -230,10 +230,12 @@ public class DoFnInvokers {
   }
 
   /**
-   * Returns a generated constructor for a {@link DoFnInvoker} for the given {@link DoFn}
class and
-   * caches it.
+   * Returns a generated constructor for a {@link DoFnInvoker} for the given {@link DoFn}
class.
+   *
+   * <p>These are cached such that at most one {@link DoFnInvoker} class exists for
a given
+   * {@link DoFn} class.
    */
-  private synchronized Constructor<?> getOrGenerateByteBuddyInvokerConstructor(
+  private synchronized Constructor<?> getByteBuddyInvokerConstructor(
       DoFnSignature signature) {
     Class<? extends DoFn<?, ?>> fnClass = signature.fnClass();
     Constructor<?> constructor = byteBuddyInvokerConstructorCache.get(fnClass);

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/546a572d/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignatures.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignatures.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignatures.java
index b7f773d..b87254e 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignatures.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignatures.java
@@ -50,7 +50,7 @@ import org.apache.beam.sdk.values.PCollection;
 import org.apache.beam.sdk.values.TypeDescriptor;
 
 /**
- * Parses a {@link DoFn} and computes its {@link DoFnSignature}. See {@link #getOrParseSignature}.
+ * Parses a {@link DoFn} and computes its {@link DoFnSignature}. See {@link #getSignature}.
  */
 public class DoFnSignatures {
   public static final DoFnSignatures INSTANCE = new DoFnSignatures();
@@ -61,11 +61,11 @@ public class DoFnSignatures {
 
   /** @return the {@link DoFnSignature} for the given {@link DoFn} instance. */
   public <FnT extends DoFn<?, ?>> DoFnSignature signatureForDoFn(FnT fn) {
-    return getOrParseSignature(fn.getClass());
+    return getSignature(fn.getClass());
   }
 
   /** @return the {@link DoFnSignature} for the given {@link DoFn} subclass. */
-  public synchronized <FnT extends DoFn<?, ?>> DoFnSignature getOrParseSignature(Class<FnT>
fn) {
+  public synchronized <FnT extends DoFn<?, ?>> DoFnSignature getSignature(Class<FnT>
fn) {
     DoFnSignature signature = signatureCache.get(fn);
     if (signature == null) {
       signatureCache.put(fn, signature = parseSignature(fn));

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/546a572d/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesProcessElementTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesProcessElementTest.java
b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesProcessElementTest.java
index 9cb1d23..329a099 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesProcessElementTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesProcessElementTest.java
@@ -141,7 +141,7 @@ public class DoFnSignaturesProcessElementTest {
         "Wrong type of OutputReceiver parameter: "
             + "OutputReceiver<InputT>, should be OutputReceiver<OutputT>");
 
-    DoFnSignatures.INSTANCE.getOrParseSignature(BadTypeVariables.class);
+    DoFnSignatures.INSTANCE.getSignature(BadTypeVariables.class);
   }
 
   @Test
@@ -149,7 +149,7 @@ public class DoFnSignaturesProcessElementTest {
     thrown.expect(IllegalArgumentException.class);
     thrown.expectMessage("No method annotated with @ProcessElement found");
     thrown.expectMessage(getClass().getName() + "$");
-    DoFnSignatures.INSTANCE.getOrParseSignature(new DoFn<String, String>() {}.getClass());
+    DoFnSignatures.INSTANCE.getSignature(new DoFn<String, String>() {}.getClass());
   }
 
   @Test
@@ -159,7 +159,7 @@ public class DoFnSignaturesProcessElementTest {
     thrown.expectMessage("foo()");
     thrown.expectMessage("bar()");
     thrown.expectMessage(getClass().getName() + "$");
-    DoFnSignatures.INSTANCE.getOrParseSignature(
+    DoFnSignatures.INSTANCE.getSignature(
         new DoFn<String, String>() {
           @ProcessElement
           public void foo() {}
@@ -175,7 +175,7 @@ public class DoFnSignaturesProcessElementTest {
     thrown.expectMessage("process()");
     thrown.expectMessage("Must be public");
     thrown.expectMessage(getClass().getName() + "$");
-    DoFnSignatures.INSTANCE.getOrParseSignature(
+    DoFnSignatures.INSTANCE.getSignature(
         new DoFn<String, String>() {
           @ProcessElement
           private void process() {}
@@ -193,7 +193,7 @@ public class DoFnSignaturesProcessElementTest {
 
   @Test
   public void testGoodTypeVariables() throws Exception {
-    DoFnSignatures.INSTANCE.getOrParseSignature(GoodTypeVariables.class);
+    DoFnSignatures.INSTANCE.getSignature(GoodTypeVariables.class);
   }
 
   private static class IdentityFn<T> extends DoFn<T, T> {
@@ -208,6 +208,6 @@ public class DoFnSignaturesProcessElementTest {
 
   @Test
   public void testIdentityFnApplied() throws Exception {
-    DoFnSignatures.INSTANCE.getOrParseSignature(new IdentityFn<String>() {}.getClass());
+    DoFnSignatures.INSTANCE.getSignature(new IdentityFn<String>() {}.getClass());
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/546a572d/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesSplittableDoFnTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesSplittableDoFnTest.java
b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesSplittableDoFnTest.java
index a9a7c81..84b909f 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesSplittableDoFnTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesSplittableDoFnTest.java
@@ -126,17 +126,17 @@ public class DoFnSignaturesSplittableDoFnTest {
     assertEquals(
         PCollection.IsBounded.BOUNDED,
         DoFnSignatures.INSTANCE
-            .getOrParseSignature(BaseSplittableFn.class)
+            .getSignature(BaseSplittableFn.class)
             .isBoundedPerElement());
     assertEquals(
         PCollection.IsBounded.BOUNDED,
         DoFnSignatures.INSTANCE
-            .getOrParseSignature(BoundedSplittableFn.class)
+            .getSignature(BoundedSplittableFn.class)
             .isBoundedPerElement());
     assertEquals(
         PCollection.IsBounded.UNBOUNDED,
         DoFnSignatures.INSTANCE
-            .getOrParseSignature(UnboundedSplittableFn.class)
+            .getSignature(UnboundedSplittableFn.class)
             .isBoundedPerElement());
   }
 
@@ -149,7 +149,7 @@ public class DoFnSignaturesSplittableDoFnTest {
     assertEquals(
         PCollection.IsBounded.BOUNDED,
         DoFnSignatures.INSTANCE
-            .getOrParseSignature(UnsplittableFn.class)
+            .getSignature(UnsplittableFn.class)
             .isBoundedPerElement());
   }
 
@@ -176,7 +176,7 @@ public class DoFnSignaturesSplittableDoFnTest {
     assertEquals(
         PCollection.IsBounded.UNBOUNDED,
         DoFnSignatures.INSTANCE
-            .getOrParseSignature(BaseFnWithContinuation.class)
+            .getSignature(BaseFnWithContinuation.class)
             .isBoundedPerElement());
   }
 
@@ -188,7 +188,7 @@ public class DoFnSignaturesSplittableDoFnTest {
     assertEquals(
         PCollection.IsBounded.BOUNDED,
         DoFnSignatures.INSTANCE
-            .getOrParseSignature(BoundedFnWithContinuation.class)
+            .getSignature(BoundedFnWithContinuation.class)
             .isBoundedPerElement());
 
     @UnboundedPerElement
@@ -197,7 +197,7 @@ public class DoFnSignaturesSplittableDoFnTest {
     assertEquals(
         PCollection.IsBounded.UNBOUNDED,
         DoFnSignatures.INSTANCE
-            .getOrParseSignature(UnboundedFnWithContinuation.class)
+            .getSignature(UnboundedFnWithContinuation.class)
             .isBoundedPerElement());
   }
 
@@ -210,7 +210,7 @@ public class DoFnSignaturesSplittableDoFnTest {
     }
 
     thrown.expectMessage("Non-splittable, but annotated as @Bounded");
-    DoFnSignatures.INSTANCE.getOrParseSignature(SomeFn.class);
+    DoFnSignatures.INSTANCE.getSignature(SomeFn.class);
   }
 
   @Test
@@ -222,7 +222,7 @@ public class DoFnSignaturesSplittableDoFnTest {
     }
 
     thrown.expectMessage("Non-splittable, but annotated as @Unbounded");
-    DoFnSignatures.INSTANCE.getOrParseSignature(SomeFn.class);
+    DoFnSignatures.INSTANCE.getSignature(SomeFn.class);
   }
 
   /** Tests a splittable {@link DoFn} that defines all methods in their full form, correctly.
*/
@@ -255,7 +255,7 @@ public class DoFnSignaturesSplittableDoFnTest {
       }
     }
 
-    DoFnSignature signature = DoFnSignatures.INSTANCE.getOrParseSignature(GoodSplittableDoFn.class);
+    DoFnSignature signature = DoFnSignatures.INSTANCE.getSignature(GoodSplittableDoFn.class);
     assertEquals(SomeRestrictionTracker.class, signature.processElement().trackerT().getRawType());
     assertTrue(signature.processElement().isSplittable());
     assertTrue(signature.processElement().hasReturnValue());
@@ -300,7 +300,7 @@ public class DoFnSignaturesSplittableDoFnTest {
     }
 
     DoFnSignature signature =
-        DoFnSignatures.INSTANCE.getOrParseSignature(
+        DoFnSignatures.INSTANCE.getSignature(
             new GoodGenericSplittableDoFn<
                 SomeRestriction, SomeRestrictionTracker, SomeRestrictionCoder>() {}.getClass());
     assertEquals(SomeRestrictionTracker.class, signature.processElement().trackerT().getRawType());
@@ -324,7 +324,7 @@ public class DoFnSignaturesSplittableDoFnTest {
     thrown.expectMessage(
         "Splittable, but does not define the following required methods: "
             + "[@GetInitialRestriction, @NewTracker]");
-    DoFnSignatures.INSTANCE.getOrParseSignature(BadFn.class);
+    DoFnSignatures.INSTANCE.getSignature(BadFn.class);
   }
 
   @Test
@@ -344,7 +344,7 @@ public class DoFnSignaturesSplittableDoFnTest {
 
     thrown.expectMessage(
         "Returns void, but must return a subtype of RestrictionTracker<SomeRestriction>");
-    DoFnSignatures.INSTANCE.getOrParseSignature(BadFn.class);
+    DoFnSignatures.INSTANCE.getSignature(BadFn.class);
   }
 
   @Test
@@ -367,7 +367,7 @@ public class DoFnSignaturesSplittableDoFnTest {
     thrown.expectMessage(
         "getInitialRestriction(Integer): Uses restriction type String, but @NewTracker method");
     thrown.expectMessage("newTracker(SomeRestriction) uses restriction type SomeRestriction");
-    DoFnSignatures.INSTANCE.getOrParseSignature(BadFn.class);
+    DoFnSignatures.INSTANCE.getSignature(BadFn.class);
   }
 
   @Test
@@ -394,7 +394,7 @@ public class DoFnSignaturesSplittableDoFnTest {
 
     thrown.expectMessage(
         "getRestrictionCoder() returns KvCoder which is not a subtype of Coder<SomeRestriction>");
-    DoFnSignatures.INSTANCE.getOrParseSignature(BadFn.class);
+    DoFnSignatures.INSTANCE.getSignature(BadFn.class);
   }
 
   @Test
@@ -479,7 +479,7 @@ public class DoFnSignaturesSplittableDoFnTest {
     thrown.expectMessage(
         "splitRestriction(Integer, OtherRestriction, OutputReceiver) "
             + "uses restriction type OtherRestriction");
-    DoFnSignatures.INSTANCE.getOrParseSignature(BadFn.class);
+    DoFnSignatures.INSTANCE.getSignature(BadFn.class);
   }
 
   @Test
@@ -511,7 +511,7 @@ public class DoFnSignaturesSplittableDoFnTest {
     thrown.expectMessage(
         "Non-splittable, but defines methods: "
             + "[@GetInitialRestriction, @SplitRestriction, @NewTracker, @GetRestrictionCoder]");
-    DoFnSignatures.INSTANCE.getOrParseSignature(BadFn.class);
+    DoFnSignatures.INSTANCE.getSignature(BadFn.class);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/546a572d/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesTest.java
b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesTest.java
index e040179..26a7b74 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/reflect/DoFnSignaturesTest.java
@@ -66,7 +66,7 @@ public class DoFnSignaturesTest {
     thrown.expectMessage("bar()");
     thrown.expectMessage("baz()");
     thrown.expectMessage(getClass().getName() + "$");
-    DoFnSignatures.INSTANCE.getOrParseSignature(
+    DoFnSignatures.INSTANCE.getSignature(
         new DoFn<String, String>() {
           @ProcessElement
           public void foo() {}
@@ -86,7 +86,7 @@ public class DoFnSignaturesTest {
     thrown.expectMessage("bar(Context)");
     thrown.expectMessage("baz(Context)");
     thrown.expectMessage(getClass().getName() + "$");
-    DoFnSignatures.INSTANCE.getOrParseSignature(
+    DoFnSignatures.INSTANCE.getSignature(
         new DoFn<String, String>() {
           @ProcessElement
           public void foo(ProcessContext context) {}
@@ -105,7 +105,7 @@ public class DoFnSignaturesTest {
     thrown.expectMessage("startBundle()");
     thrown.expectMessage("Must be public");
     thrown.expectMessage(getClass().getName() + "$");
-    DoFnSignatures.INSTANCE.getOrParseSignature(
+    DoFnSignatures.INSTANCE.getSignature(
         new DoFn<String, String>() {
           @ProcessElement
           public void processElement() {}
@@ -121,7 +121,7 @@ public class DoFnSignaturesTest {
     thrown.expectMessage("finishBundle()");
     thrown.expectMessage("Must be public");
     thrown.expectMessage(getClass().getName() + "$");
-    DoFnSignatures.INSTANCE.getOrParseSignature(
+    DoFnSignatures.INSTANCE.getSignature(
         new DoFn<String, String>() {
           @ProcessElement
           public void processElement() {}
@@ -136,7 +136,7 @@ public class DoFnSignaturesTest {
     thrown.expect(IllegalArgumentException.class);
     thrown.expectMessage("StateId");
     thrown.expectMessage("StateSpec");
-    DoFnSignatures.INSTANCE.getOrParseSignature(
+    DoFnSignatures.INSTANCE.getSignature(
         new DoFn<String, String>() {
           @StateId("foo")
           String bizzle = "bazzle";
@@ -155,7 +155,7 @@ public class DoFnSignaturesTest {
     thrown.expectMessage("myfield1");
     thrown.expectMessage("myfield2");
     DoFnSignature sig =
-        DoFnSignatures.INSTANCE.getOrParseSignature(
+        DoFnSignatures.INSTANCE.getSignature(
             new DoFn<KV<String, Integer>, Long>() {
               @StateId("my-state-id")
               private final StateSpec<Object, ValueState<Integer>> myfield1 =
@@ -176,7 +176,7 @@ public class DoFnSignaturesTest {
     thrown.expectMessage("Non-final field");
     thrown.expectMessage("myfield");
     DoFnSignature sig =
-        DoFnSignatures.INSTANCE.getOrParseSignature(
+        DoFnSignatures.INSTANCE.getSignature(
             new DoFn<KV<String, Integer>, Long>() {
               @StateId("my-state-id")
               private StateSpec<Object, ValueState<Integer>> myfield =
@@ -190,7 +190,7 @@ public class DoFnSignaturesTest {
   @Test
   public void testSimpleStateIdAnonymousDoFn() throws Exception {
     DoFnSignature sig =
-        DoFnSignatures.INSTANCE.getOrParseSignature(
+        DoFnSignatures.INSTANCE.getSignature(
             new DoFn<KV<String, Integer>, Long>() {
               @StateId("foo")
               private final StateSpec<Object, ValueState<Integer>> bizzle =


Mime
View raw message