beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [2/6] incubator-beam git commit: Rename BoundedWindowParameter -> WindowParameter
Date Mon, 07 Nov 2016 23:32:27 GMT
Rename BoundedWindowParameter -> WindowParameter


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

Branch: refs/heads/master
Commit: 85b908be5b5858ff9dfb5d7f04c0e3ca28dbaa05
Parents: e2db826
Author: Kenneth Knowles <klk@google.com>
Authored: Thu Nov 3 21:27:24 2016 -0700
Committer: Kenneth Knowles <klk@google.com>
Committed: Mon Nov 7 15:25:03 2016 -0800

----------------------------------------------------------------------
 .../sdk/transforms/reflect/DoFnInvokers.java    |  4 ++--
 .../sdk/transforms/reflect/DoFnSignature.java   | 24 ++++++++++----------
 .../transforms/reflect/DoFnSignaturesTest.java  |  3 ++-
 3 files changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/85b908be/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 b7f75ed..ba95f98 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
@@ -68,13 +68,13 @@ import org.apache.beam.sdk.transforms.DoFn.ExtraContextFactory;
 import org.apache.beam.sdk.transforms.DoFn.ProcessElement;
 import org.apache.beam.sdk.transforms.DoFnAdapters;
 import org.apache.beam.sdk.transforms.OldDoFn;
-import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.BoundedWindowParameter;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.Cases;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.InputProviderParameter;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.OutputReceiverParameter;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.RestrictionTrackerParameter;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.StateParameter;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.TimerParameter;
+import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.WindowParameter;
 import org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker;
 import org.apache.beam.sdk.util.Timer;
 import org.apache.beam.sdk.util.UserCodeException;
@@ -537,7 +537,7 @@ public class DoFnInvokers {
         new Cases<StackManipulation>() {
 
           @Override
-          public StackManipulation dispatch(BoundedWindowParameter p) {
+          public StackManipulation dispatch(WindowParameter p) {
             return simpleExtraContextParameter("window", pushExtraContextFactory);
           }
 

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/85b908be/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignature.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignature.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignature.java
index a189bd5..befc10b 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignature.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignature.java
@@ -33,9 +33,9 @@ import org.apache.beam.sdk.transforms.DoFn.OutputReceiver;
 import org.apache.beam.sdk.transforms.DoFn.ProcessContinuation;
 import org.apache.beam.sdk.transforms.DoFn.StateId;
 import org.apache.beam.sdk.transforms.DoFn.TimerId;
-import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.BoundedWindowParameter;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.RestrictionTrackerParameter;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.StateParameter;
+import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.WindowParameter;
 import org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker;
 import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
 import org.apache.beam.sdk.util.Timer;
@@ -159,8 +159,8 @@ public abstract class DoFnSignature {
     public <ResultT> ResultT match(Cases<ResultT> cases) {
       // This could be done with reflection, but since the number of cases is small and known,
       // they are simply inlined.
-      if (this instanceof BoundedWindowParameter) {
-        return cases.dispatch((BoundedWindowParameter) this);
+      if (this instanceof WindowParameter) {
+        return cases.dispatch((WindowParameter) this);
       } else if (this instanceof RestrictionTrackerParameter) {
         return cases.dispatch((RestrictionTrackerParameter) this);
       } else if (this instanceof InputProviderParameter) {
@@ -182,7 +182,7 @@ public abstract class DoFnSignature {
      * An interface for destructuring a {@link Parameter}.
      */
     public interface Cases<ResultT> {
-      ResultT dispatch(BoundedWindowParameter p);
+      ResultT dispatch(WindowParameter p);
       ResultT dispatch(InputProviderParameter p);
       ResultT dispatch(OutputReceiverParameter p);
       ResultT dispatch(RestrictionTrackerParameter p);
@@ -197,7 +197,7 @@ public abstract class DoFnSignature {
         protected abstract ResultT dispatchDefault(Parameter p);
 
         @Override
-        public ResultT dispatch(BoundedWindowParameter p) {
+        public ResultT dispatch(WindowParameter p) {
           return dispatchDefault(p);
         }
 
@@ -229,17 +229,17 @@ public abstract class DoFnSignature {
     }
 
     // These parameter descriptors are constant
-    private static final BoundedWindowParameter BOUNDED_WINDOW_PARAMETER =
-        new AutoValue_DoFnSignature_Parameter_BoundedWindowParameter();
+    private static final WindowParameter BOUNDED_WINDOW_PARAMETER =
+        new AutoValue_DoFnSignature_Parameter_WindowParameter();
     private static final InputProviderParameter INPUT_PROVIDER_PARAMETER =
         new AutoValue_DoFnSignature_Parameter_InputProviderParameter();
     private static final OutputReceiverParameter OUTPUT_RECEIVER_PARAMETER =
         new AutoValue_DoFnSignature_Parameter_OutputReceiverParameter();
 
     /**
-     * Returns a {@link BoundedWindowParameter}.
+     * Returns a {@link WindowParameter}.
      */
-    public static BoundedWindowParameter boundedWindow() {
+    public static WindowParameter boundedWindow() {
       return BOUNDED_WINDOW_PARAMETER;
     }
 
@@ -281,8 +281,8 @@ public abstract class DoFnSignature {
      * <p>All such descriptors are equal.
      */
     @AutoValue
-    public abstract static class BoundedWindowParameter extends Parameter {
-      BoundedWindowParameter() {}
+    public abstract static class WindowParameter extends Parameter {
+      WindowParameter() {}
     }
 
     /**
@@ -380,7 +380,7 @@ public abstract class DoFnSignature {
       return Iterables.any(
           extraParameters(),
           Predicates.or(
-              Predicates.instanceOf(BoundedWindowParameter.class),
+              Predicates.instanceOf(WindowParameter.class),
               Predicates.instanceOf(StateParameter.class)));
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/85b908be/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 4187e0a..fe78749 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
@@ -33,6 +33,7 @@ import org.apache.beam.sdk.transforms.DoFn;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.StateParameter;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.TimerParameter;
+import org.apache.beam.sdk.transforms.reflect.DoFnSignature.Parameter.WindowParameter;
 import org.apache.beam.sdk.transforms.reflect.DoFnSignaturesTestUtils.FakeDoFn;
 import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
 import org.apache.beam.sdk.util.TimeDomain;
@@ -310,7 +311,7 @@ public class DoFnSignaturesTest {
     assertThat(sig.onTimerMethods().get(timerId).extraParameters().size(), equalTo(1));
     assertThat(
         sig.onTimerMethods().get(timerId).extraParameters().get(0),
-        instanceOf(DoFnSignature.Parameter.BoundedWindowParameter.class));
+        instanceOf(WindowParameter.class));
   }
 
   @Test


Mime
View raw message