beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [2/2] incubator-beam git commit: [BEAM-800] add getFn to DoFnInvoker
Date Sat, 26 Nov 2016 04:41:38 GMT
[BEAM-800] add getFn to DoFnInvoker


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

Branch: refs/heads/master
Commit: 8d7d46c6e407c738a61b236078d002d178da0b9f
Parents: 8d1214a
Author: manuzhang <owenzhang1990@gmail.com>
Authored: Wed Nov 23 09:24:05 2016 +0800
Committer: Kenneth Knowles <klk@google.com>
Committed: Fri Nov 25 20:34:12 2016 -0800

----------------------------------------------------------------------
 .../sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java     | 5 +++++
 .../org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java     | 3 +++
 .../org/apache/beam/sdk/transforms/reflect/DoFnInvokers.java    | 5 +++++
 3 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/8d7d46c6/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 9998c9d..408ea98 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
@@ -175,6 +175,11 @@ public class ByteBuddyDoFnInvokerFactory implements DoFnInvokerFactory
{
                 timerId, delegate.getClass().getName()));
       }
     }
+
+    @Override
+    public DoFn<InputT, OutputT> getFn() {
+      return delegate;
+    }
   }
 
   /** @return the {@link DoFnInvoker} for the given {@link DoFn}. */

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/8d7d46c6/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java
index d899207..5e61bdd 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java
@@ -84,6 +84,9 @@ public interface DoFnInvoker<InputT, OutputT> {
   <RestrictionT, TrackerT extends RestrictionTracker<RestrictionT>> TrackerT
invokeNewTracker(
       RestrictionT restriction);
 
+  /** Get the bound {@link DoFn}. */
+  DoFn<InputT, OutputT> getFn();
+
   /**
    * Interface for runner implementors to provide implementations of extra context information.
    *

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/8d7d46c6/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 15ba198..4ad7dad 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
@@ -180,5 +180,10 @@ public class DoFnInvokers {
         TrackerT invokeNewTracker(RestrictionT restriction) {
       throw new UnsupportedOperationException("OldDoFn is not splittable");
     }
+
+    @Override
+    public DoFn<InputT, OutputT> getFn() {
+      throw new UnsupportedOperationException("getFn is not supported for OldDoFn");
+    }
   }
 }


Mime
View raw message