beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [4/5] incubator-beam git commit: Support OnTimerContext in ByteBuddyDoFnInvokerFactory
Date Thu, 08 Dec 2016 03:30:14 GMT
Support OnTimerContext in ByteBuddyDoFnInvokerFactory


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

Branch: refs/heads/master
Commit: a26ed134bc57970ed83156f93d660a637465a9d6
Parents: 2883062
Author: Kenneth Knowles <klk@google.com>
Authored: Tue Dec 6 20:19:32 2016 -0800
Committer: Kenneth Knowles <klk@google.com>
Committed: Wed Dec 7 19:22:44 2016 -0800

----------------------------------------------------------------------
 .../sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/a26ed134/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java
index 3480603..01ddd86 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java
@@ -85,6 +85,7 @@ public class ByteBuddyDoFnInvokerFactory implements DoFnInvokerFactory {
 
   public static final String CONTEXT_PARAMETER_METHOD = "context";
   public static final String PROCESS_CONTEXT_PARAMETER_METHOD = "processContext";
+  public static final String ON_TIMER_CONTEXT_PARAMETER_METHOD = "onTimerContext";
   public static final String WINDOW_PARAMETER_METHOD = "window";
   public static final String INPUT_PROVIDER_PARAMETER_METHOD = "inputProvider";
   public static final String OUTPUT_RECEIVER_PARAMETER_METHOD = "outputReceiver";
@@ -556,7 +557,11 @@ public class ByteBuddyDoFnInvokerFactory implements DoFnInvokerFactory
{
 
           @Override
           public StackManipulation dispatch(OnTimerContextParameter p) {
-            throw new UnsupportedOperationException("OnTimerContext is not yet supported.");
+            return new StackManipulation.Compound(
+                pushDelegate,
+                MethodInvocation.invoke(
+                    getExtraContextFactoryMethodDescription(
+                        ON_TIMER_CONTEXT_PARAMETER_METHOD, DoFn.class)));
           }
 
           @Override


Mime
View raw message