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 Unnecessary Fn cloning
Date Wed, 08 Jun 2016 16:15:45 GMT
Repository: incubator-beam
Updated Branches:
  refs/heads/master cc448e976 -> 9a3896d69


Remove Unnecessary Fn cloning

The ParDoInProcessEvaluator is provided clones of a DoFn when
appropriate, and should not serialize them.


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

Branch: refs/heads/master
Commit: 0cf17302f605aefde22c48e65e17da6e3cfc6238
Parents: 2173000
Author: Thomas Groh <tgroh@google.com>
Authored: Fri Jun 3 17:57:24 2016 -0700
Committer: Thomas Groh <tgroh@google.com>
Committed: Tue Jun 7 14:20:42 2016 -0700

----------------------------------------------------------------------
 .../org/apache/beam/runners/direct/ParDoInProcessEvaluator.java  | 3 +--
 .../apache/beam/runners/direct/ParDoInProcessEvaluatorTest.java  | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/0cf17302/runners/direct-java/src/main/java/org/apache/beam/runners/direct/ParDoInProcessEvaluator.java
----------------------------------------------------------------------
diff --git a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/ParDoInProcessEvaluator.java
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/ParDoInProcessEvaluator.java
index 2cdf6cb..a3e2f18 100644
--- a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/ParDoInProcessEvaluator.java
+++ b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/ParDoInProcessEvaluator.java
@@ -27,7 +27,6 @@ import org.apache.beam.sdk.util.DoFnRunners;
 import org.apache.beam.sdk.util.DoFnRunners.OutputManager;
 import org.apache.beam.sdk.util.PushbackSideInputDoFnRunner;
 import org.apache.beam.sdk.util.ReadyCheckingSideInputReader;
-import org.apache.beam.sdk.util.SerializableUtils;
 import org.apache.beam.sdk.util.UserCodeException;
 import org.apache.beam.sdk.util.WindowedValue;
 import org.apache.beam.sdk.util.common.CounterSet;
@@ -74,7 +73,7 @@ class ParDoInProcessEvaluator<T> implements TransformEvaluator<T>
{
     DoFnRunner<InputT, OutputT> underlying =
         DoFnRunners.createDefault(
             evaluationContext.getPipelineOptions(),
-            SerializableUtils.clone(fn),
+            fn,
             sideInputReader,
             BundleOutputManager.create(outputBundles),
             mainOutputTag,

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/0cf17302/runners/direct-java/src/test/java/org/apache/beam/runners/direct/ParDoInProcessEvaluatorTest.java
----------------------------------------------------------------------
diff --git a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/ParDoInProcessEvaluatorTest.java
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/ParDoInProcessEvaluatorTest.java
index 1127ed2..0f7afa1 100644
--- a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/ParDoInProcessEvaluatorTest.java
+++ b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/ParDoInProcessEvaluatorTest.java
@@ -128,7 +128,7 @@ public class ParDoInProcessEvaluatorTest {
         Matchers.<WindowedValue<?>>containsInAnyOrder(
             second, WindowedValue.of(1, new Instant(2468L), nonGlobalWindow, PaneInfo.NO_FIRING)));
     assertThat(result.getOutputBundles(), Matchers.<UncommittedBundle<?>>contains(outputBundle));
-    assertThat(RecorderFn.processed, containsInAnyOrder(1, 3));
+    assertThat(fn.processed, containsInAnyOrder(1, 3));
     assertThat(
         Iterables.getOnlyElement(result.getOutputBundles()).commit(Instant.now()).getElements(),
         Matchers.<WindowedValue<?>>containsInAnyOrder(
@@ -170,7 +170,7 @@ public class ParDoInProcessEvaluatorTest {
   }
 
   private static class RecorderFn extends DoFn<Integer, Integer> {
-    private static Collection<Integer> processed;
+    private Collection<Integer> processed;
     private final PCollectionView<Integer> view;
 
     public RecorderFn(PCollectionView<Integer> view) {


Mime
View raw message