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: Rename DoFnTester#processBatch to processBundle
Date Wed, 15 Jun 2016 03:38:01 GMT
Repository: incubator-beam
Updated Branches:
  refs/heads/master 2b269559f -> 315b3c8e3


Rename DoFnTester#processBatch to processBundle

DoFns process elements in bundles, not batches.


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

Branch: refs/heads/master
Commit: 43f3aa307a1099031ff6c69e8315c4912bd6be46
Parents: 7749440
Author: Thomas Groh <tgroh@google.com>
Authored: Tue Jun 14 09:27:55 2016 -0700
Committer: Thomas Groh <tgroh@google.com>
Committed: Tue Jun 14 11:24:46 2016 -0700

----------------------------------------------------------------------
 .../org/apache/beam/examples/WordCountTest.java |  6 +++---
 .../cookbook/BigQueryTornadoesTest.java         |  8 ++++----
 .../cookbook/CombinePerKeyExamplesTest.java     |  4 ++--
 .../examples/cookbook/FilterExamplesTest.java   |  4 ++--
 .../examples/cookbook/JoinExamplesTest.java     |  4 ++--
 .../cookbook/MaxPerKeyExamplesTest.java         |  4 ++--
 .../examples/cookbook/TriggerExampleTest.java   |  4 ++--
 .../examples/complete/game/UserScoreTest.java   |  2 +-
 .../dataflow/DataflowPipelineRunnerTest.java    | 20 ++++++++++----------
 .../apache/beam/sdk/transforms/DoFnTester.java  | 16 ++++++++--------
 .../beam/sdk/transforms/DoFnTesterTest.java     | 10 +++++-----
 .../sdk/transforms/join/CoGroupByKeyTest.java   |  2 +-
 .../src/test/java/WordCountTest.java            |  6 +++---
 13 files changed, 45 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/examples/java/src/test/java/org/apache/beam/examples/WordCountTest.java
----------------------------------------------------------------------
diff --git a/examples/java/src/test/java/org/apache/beam/examples/WordCountTest.java b/examples/java/src/test/java/org/apache/beam/examples/WordCountTest.java
index 1382612..ff117dc 100644
--- a/examples/java/src/test/java/org/apache/beam/examples/WordCountTest.java
+++ b/examples/java/src/test/java/org/apache/beam/examples/WordCountTest.java
@@ -52,11 +52,11 @@ public class WordCountTest {
     DoFnTester<String, String> extractWordsFn =
         DoFnTester.of(new ExtractWordsFn());
 
-    Assert.assertThat(extractWordsFn.processBatch(" some  input  words "),
+    Assert.assertThat(extractWordsFn.processBundle(" some  input  words "),
                       CoreMatchers.hasItems("some", "input", "words"));
-    Assert.assertThat(extractWordsFn.processBatch(" "),
+    Assert.assertThat(extractWordsFn.processBundle(" "),
                       CoreMatchers.<String>hasItems());
-    Assert.assertThat(extractWordsFn.processBatch(" some ", " input", " words"),
+    Assert.assertThat(extractWordsFn.processBundle(" some ", " input", " words"),
                       CoreMatchers.hasItems("some", "input", "words"));
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/examples/java/src/test/java/org/apache/beam/examples/cookbook/BigQueryTornadoesTest.java
----------------------------------------------------------------------
diff --git a/examples/java/src/test/java/org/apache/beam/examples/cookbook/BigQueryTornadoesTest.java
b/examples/java/src/test/java/org/apache/beam/examples/cookbook/BigQueryTornadoesTest.java
index 36be568..b986c0b 100644
--- a/examples/java/src/test/java/org/apache/beam/examples/cookbook/BigQueryTornadoesTest.java
+++ b/examples/java/src/test/java/org/apache/beam/examples/cookbook/BigQueryTornadoesTest.java
@@ -45,7 +45,7 @@ public class BigQueryTornadoesTest {
           .set("tornado", true);
     DoFnTester<TableRow, Integer> extractWordsFn =
         DoFnTester.of(new ExtractTornadoesFn());
-    Assert.assertThat(extractWordsFn.processBatch(row),
+    Assert.assertThat(extractWordsFn.processBundle(row),
                       CoreMatchers.hasItems(6));
   }
 
@@ -56,7 +56,7 @@ public class BigQueryTornadoesTest {
           .set("tornado", false);
     DoFnTester<TableRow, Integer> extractWordsFn =
         DoFnTester.of(new ExtractTornadoesFn());
-    Assert.assertTrue(extractWordsFn.processBatch(row).isEmpty());
+    Assert.assertTrue(extractWordsFn.processBundle(row).isEmpty());
   }
 
   @Test
@@ -65,12 +65,12 @@ public class BigQueryTornadoesTest {
     DoFnTester<KV<Integer, Long>, TableRow> formatCountsFn =
         DoFnTester.of(new FormatCountsFn());
     KV empty[] = {};
-    List<TableRow> results = formatCountsFn.processBatch(empty);
+    List<TableRow> results = formatCountsFn.processBundle(empty);
     Assert.assertTrue(results.size() == 0);
     KV input[] = { KV.of(3, 0L),
                    KV.of(4, Long.MAX_VALUE),
                    KV.of(5, Long.MIN_VALUE) };
-    results = formatCountsFn.processBatch(input);
+    results = formatCountsFn.processBundle(input);
     Assert.assertEquals(results.size(), 3);
     Assert.assertEquals(results.get(0).get("month"), 3);
     Assert.assertEquals(results.get(0).get("tornado_count"), 0L);

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/examples/java/src/test/java/org/apache/beam/examples/cookbook/CombinePerKeyExamplesTest.java
----------------------------------------------------------------------
diff --git a/examples/java/src/test/java/org/apache/beam/examples/cookbook/CombinePerKeyExamplesTest.java
b/examples/java/src/test/java/org/apache/beam/examples/cookbook/CombinePerKeyExamplesTest.java
index 5d6456a..6d0b167 100644
--- a/examples/java/src/test/java/org/apache/beam/examples/cookbook/CombinePerKeyExamplesTest.java
+++ b/examples/java/src/test/java/org/apache/beam/examples/cookbook/CombinePerKeyExamplesTest.java
@@ -75,7 +75,7 @@ public class CombinePerKeyExamplesTest {
   public void testExtractLargeWordsFn() throws Exception {
     DoFnTester<TableRow, KV<String, String>> extractLargeWordsFn =
         DoFnTester.of(new ExtractLargeWordsFn());
-    List<KV<String, String>> results = extractLargeWordsFn.processBatch(ROWS_ARRAY);
+    List<KV<String, String>> results = extractLargeWordsFn.processBundle(ROWS_ARRAY);
     Assert.assertThat(results, CoreMatchers.hasItem(tuple1));
     Assert.assertThat(results, CoreMatchers.hasItem(tuple2));
     Assert.assertThat(results, CoreMatchers.hasItem(tuple3));
@@ -85,7 +85,7 @@ public class CombinePerKeyExamplesTest {
   public void testFormatShakespeareOutputFn() throws Exception {
     DoFnTester<KV<String, String>, TableRow> formatShakespeareOutputFn =
         DoFnTester.of(new FormatShakespeareOutputFn());
-    List<TableRow> results = formatShakespeareOutputFn.processBatch(COMBINED_TUPLES_ARRAY);
+    List<TableRow> results = formatShakespeareOutputFn.processBundle(COMBINED_TUPLES_ARRAY);
     Assert.assertThat(results, CoreMatchers.hasItem(resultRow1));
     Assert.assertThat(results, CoreMatchers.hasItem(resultRow2));
   }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/examples/java/src/test/java/org/apache/beam/examples/cookbook/FilterExamplesTest.java
----------------------------------------------------------------------
diff --git a/examples/java/src/test/java/org/apache/beam/examples/cookbook/FilterExamplesTest.java
b/examples/java/src/test/java/org/apache/beam/examples/cookbook/FilterExamplesTest.java
index 13beab0..2598a97 100644
--- a/examples/java/src/test/java/org/apache/beam/examples/cookbook/FilterExamplesTest.java
+++ b/examples/java/src/test/java/org/apache/beam/examples/cookbook/FilterExamplesTest.java
@@ -71,7 +71,7 @@ public class FilterExamplesTest {
   public void testProjectionFn() throws Exception {
     DoFnTester<TableRow, TableRow> projectionFn =
         DoFnTester.of(new ProjectionFn());
-    List<TableRow> results = projectionFn.processBatch(ROWS_ARRAY);
+    List<TableRow> results = projectionFn.processBundle(ROWS_ARRAY);
     Assert.assertThat(results, CoreMatchers.hasItem(outRow1));
     Assert.assertThat(results, CoreMatchers.hasItem(outRow2));
     Assert.assertThat(results, CoreMatchers.hasItem(outRow3));
@@ -81,7 +81,7 @@ public class FilterExamplesTest {
   public void testFilterSingleMonthDataFn() throws Exception {
     DoFnTester<TableRow, TableRow> filterSingleMonthDataFn =
         DoFnTester.of(new FilterSingleMonthDataFn(7));
-    List<TableRow> results = filterSingleMonthDataFn.processBatch(PROJROWS_ARRAY);
+    List<TableRow> results = filterSingleMonthDataFn.processBundle(PROJROWS_ARRAY);
     Assert.assertThat(results, CoreMatchers.hasItem(outRow2));
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/examples/java/src/test/java/org/apache/beam/examples/cookbook/JoinExamplesTest.java
----------------------------------------------------------------------
diff --git a/examples/java/src/test/java/org/apache/beam/examples/cookbook/JoinExamplesTest.java
b/examples/java/src/test/java/org/apache/beam/examples/cookbook/JoinExamplesTest.java
index 22fe6a1..9b04667 100644
--- a/examples/java/src/test/java/org/apache/beam/examples/cookbook/JoinExamplesTest.java
+++ b/examples/java/src/test/java/org/apache/beam/examples/cookbook/JoinExamplesTest.java
@@ -87,7 +87,7 @@ public class JoinExamplesTest {
   public void testExtractEventDataFn() throws Exception {
     DoFnTester<TableRow, KV<String, String>> extractEventDataFn =
         DoFnTester.of(new ExtractEventDataFn());
-    List<KV<String, String>> results = extractEventDataFn.processBatch(EVENTS);
+    List<KV<String, String>> results = extractEventDataFn.processBundle(EVENTS);
     Assert.assertThat(results, CoreMatchers.hasItem(kv1));
     Assert.assertThat(results, CoreMatchers.hasItem(kv2));
   }
@@ -96,7 +96,7 @@ public class JoinExamplesTest {
   public void testExtractCountryInfoFn() throws Exception {
     DoFnTester<TableRow, KV<String, String>> extractCountryInfoFn =
         DoFnTester.of(new ExtractCountryInfoFn());
-    List<KV<String, String>> results = extractCountryInfoFn.processBatch(CCS);
+    List<KV<String, String>> results = extractCountryInfoFn.processBundle(CCS);
     Assert.assertThat(results, CoreMatchers.hasItem(kv3));
     Assert.assertThat(results, CoreMatchers.hasItem(kv4));
   }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/examples/java/src/test/java/org/apache/beam/examples/cookbook/MaxPerKeyExamplesTest.java
----------------------------------------------------------------------
diff --git a/examples/java/src/test/java/org/apache/beam/examples/cookbook/MaxPerKeyExamplesTest.java
b/examples/java/src/test/java/org/apache/beam/examples/cookbook/MaxPerKeyExamplesTest.java
index 9e129a1..1d5bcf4 100644
--- a/examples/java/src/test/java/org/apache/beam/examples/cookbook/MaxPerKeyExamplesTest.java
+++ b/examples/java/src/test/java/org/apache/beam/examples/cookbook/MaxPerKeyExamplesTest.java
@@ -69,7 +69,7 @@ public class MaxPerKeyExamplesTest {
   public void testExtractTempFn() throws Exception {
     DoFnTester<TableRow, KV<Integer, Double>> extractTempFn =
         DoFnTester.of(new ExtractTempFn());
-    List<KV<Integer, Double>> results = extractTempFn.processBatch(TEST_ROWS);
+    List<KV<Integer, Double>> results = extractTempFn.processBundle(TEST_ROWS);
     Assert.assertThat(results, CoreMatchers.hasItem(kv1));
     Assert.assertThat(results, CoreMatchers.hasItem(kv2));
     Assert.assertThat(results, CoreMatchers.hasItem(kv3));
@@ -79,7 +79,7 @@ public class MaxPerKeyExamplesTest {
   public void testFormatMaxesFn() throws Exception {
     DoFnTester<KV<Integer, Double>, TableRow> formatMaxesFnFn =
         DoFnTester.of(new FormatMaxesFn());
-    List<TableRow> results = formatMaxesFnFn.processBatch(TEST_KVS);
+    List<TableRow> results = formatMaxesFnFn.processBundle(TEST_KVS);
     Assert.assertThat(results, CoreMatchers.hasItem(resultRow1));
     Assert.assertThat(results, CoreMatchers.hasItem(resultRow2));
   }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/examples/java/src/test/java/org/apache/beam/examples/cookbook/TriggerExampleTest.java
----------------------------------------------------------------------
diff --git a/examples/java/src/test/java/org/apache/beam/examples/cookbook/TriggerExampleTest.java
b/examples/java/src/test/java/org/apache/beam/examples/cookbook/TriggerExampleTest.java
index cddce7f..6f58389 100644
--- a/examples/java/src/test/java/org/apache/beam/examples/cookbook/TriggerExampleTest.java
+++ b/examples/java/src/test/java/org/apache/beam/examples/cookbook/TriggerExampleTest.java
@@ -101,12 +101,12 @@ public class TriggerExampleTest {
     DoFnTester<String, KV<String, Integer>> extractFlowInfow = DoFnTester
         .of(new ExtractFlowInfo());
 
-    List<KV<String, Integer>> results = extractFlowInfow.processBatch(INPUT);
+    List<KV<String, Integer>> results = extractFlowInfow.processBundle(INPUT);
     Assert.assertEquals(results.size(), 1);
     Assert.assertEquals(results.get(0).getKey(), "94");
     Assert.assertEquals(results.get(0).getValue(), new Integer(29));
 
-    List<KV<String, Integer>> output = extractFlowInfow.processBatch("");
+    List<KV<String, Integer>> output = extractFlowInfow.processBundle("");
     Assert.assertEquals(output.size(), 0);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/examples/java8/src/test/java/org/apache/beam/examples/complete/game/UserScoreTest.java
----------------------------------------------------------------------
diff --git a/examples/java8/src/test/java/org/apache/beam/examples/complete/game/UserScoreTest.java
b/examples/java8/src/test/java/org/apache/beam/examples/complete/game/UserScoreTest.java
index 6f58114..cc3e7fa 100644
--- a/examples/java8/src/test/java/org/apache/beam/examples/complete/game/UserScoreTest.java
+++ b/examples/java8/src/test/java/org/apache/beam/examples/complete/game/UserScoreTest.java
@@ -89,7 +89,7 @@ public class UserScoreTest implements Serializable {
     DoFnTester<String, GameActionInfo> parseEventFn =
         DoFnTester.of(new ParseEventFn());
 
-    List<GameActionInfo> results = parseEventFn.processBatch(GAME_EVENTS_ARRAY);
+    List<GameActionInfo> results = parseEventFn.processBundle(GAME_EVENTS_ARRAY);
     Assert.assertEquals(results.size(), 8);
     Assert.assertEquals(results.get(0).getUser(), "user0_MagentaKangaroo");
     Assert.assertEquals(results.get(0).getTeam(), "MagentaKangaroo");

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/DataflowPipelineRunnerTest.java
----------------------------------------------------------------------
diff --git a/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/DataflowPipelineRunnerTest.java
b/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/DataflowPipelineRunnerTest.java
index f7068b0..38d4c96 100644
--- a/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/DataflowPipelineRunnerTest.java
+++ b/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/DataflowPipelineRunnerTest.java
@@ -961,7 +961,7 @@ public class DataflowPipelineRunnerTest {
                    <String, GlobalWindow>(GlobalWindow.Coder.INSTANCE));
 
     assertThat(
-        doFnTester.processBatch(
+        doFnTester.processBundle(
             ImmutableList.of(KV.<Integer, Iterable<KV<GlobalWindow, WindowedValue<String>>>>of(
                 0, ImmutableList.of(KV.of(GlobalWindow.INSTANCE, valueInGlobalWindow("a")))))),
         contains(IsmRecord.of(ImmutableList.of(GlobalWindow.INSTANCE), valueInGlobalWindow("a"))));
@@ -978,7 +978,7 @@ public class DataflowPipelineRunnerTest {
 
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("found for singleton within window");
-    doFnTester.processBatch(ImmutableList.of(
+    doFnTester.processBundle(ImmutableList.of(
         KV.<Integer, Iterable<KV<GlobalWindow, WindowedValue<String>>>>of(0,
             ImmutableList.of(KV.of(GlobalWindow.INSTANCE, valueInGlobalWindow("a")),
                 KV.of(GlobalWindow.INSTANCE, valueInGlobalWindow("b"))))));
@@ -990,7 +990,7 @@ public class DataflowPipelineRunnerTest {
         DoFnTester.of(new BatchViewAsList.ToIsmRecordForGlobalWindowDoFn<String>());
 
     // The order of the output elements is important relative to processing order
-    assertThat(doFnTester.processBatch(ImmutableList.of("a", "b", "c")), contains(
+    assertThat(doFnTester.processBundle(ImmutableList.of("a", "b", "c")), contains(
         IsmRecord.of(ImmutableList.of(GlobalWindow.INSTANCE, 0L), valueInGlobalWindow("a")),
         IsmRecord.of(ImmutableList.of(GlobalWindow.INSTANCE, 1L), valueInGlobalWindow("b")),
         IsmRecord.of(ImmutableList.of(GlobalWindow.INSTANCE, 2L), valueInGlobalWindow("c"))));
@@ -1028,7 +1028,7 @@ public class DataflowPipelineRunnerTest {
                 )));
 
     // The order of the output elements is important relative to processing order
-    assertThat(doFnTester.processBatch(inputElements), contains(
+    assertThat(doFnTester.processBundle(inputElements), contains(
         IsmRecord.of(ImmutableList.of(windowA, 0L),
             WindowedValue.of(110L, new Instant(1), windowA, PaneInfo.NO_FIRING)),
         IsmRecord.of(ImmutableList.of(windowA, 1L),
@@ -1100,7 +1100,7 @@ public class DataflowPipelineRunnerTest {
                     WindowedValue.of(330L, new Instant(21), windowC, PaneInfo.NO_FIRING)))));
 
     // The order of the output elements is important relative to processing order
-    assertThat(doFnTester.processBatch(inputElements), contains(
+    assertThat(doFnTester.processBundle(inputElements), contains(
         IsmRecord.of(
             ImmutableList.of(1L, windowA, 0L),
             WindowedValue.of(110L, new Instant(1), windowA, PaneInfo.NO_FIRING)),
@@ -1188,7 +1188,7 @@ public class DataflowPipelineRunnerTest {
 
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("Unique keys are expected but found key");
-    doFnTester.processBatch(inputElements);
+    doFnTester.processBundle(inputElements);
   }
 
   @Test
@@ -1231,7 +1231,7 @@ public class DataflowPipelineRunnerTest {
                     KV.of(windowC, 9L))));
 
     // The order of the output elements is important relative to processing order
-    assertThat(doFnTester.processBatch(inputElements), contains(
+    assertThat(doFnTester.processBundle(inputElements), contains(
         IsmRecord.<WindowedValue<Long>>meta(
             ImmutableList.of(IsmFormat.getMetadataKey(), windowA, 0L),
             CoderUtils.encodeToByteArray(VarLongCoder.of(), 5L)),
@@ -1286,7 +1286,7 @@ public class DataflowPipelineRunnerTest {
                     KV.of(windowC, 3L))));
 
     // The order of the output elements is important relative to processing order
-    assertThat(doFnTester.processBatch(inputElements), contains(
+    assertThat(doFnTester.processBundle(inputElements), contains(
         IsmRecord.<WindowedValue<Long>>meta(
             ImmutableList.of(IsmFormat.getMetadataKey(), windowA, 1L),
             CoderUtils.encodeToByteArray(VarLongCoder.of(), 2L)),
@@ -1339,7 +1339,7 @@ public class DataflowPipelineRunnerTest {
     List<IsmRecord<WindowedValue<TransformedMap<Long,
                                                 WindowedValue<Long>,
                                                 Long>>>> output =
-                                                doFnTester.processBatch(inputElements);
+                                                doFnTester.processBundle(inputElements);
     assertEquals(3, output.size());
     Map<Long, Long> outputMap;
 
@@ -1396,7 +1396,7 @@ public class DataflowPipelineRunnerTest {
     List<IsmRecord<WindowedValue<TransformedMap<Long,
                                                 Iterable<WindowedValue<Long>>,
                                                 Iterable<Long>>>>> output
=
-                                                doFnTester.processBatch(inputElements);
+                                                doFnTester.processBundle(inputElements);
     assertEquals(3, output.size());
     Map<Long, Iterable<Long>> outputMap;
 

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFnTester.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFnTester.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFnTester.java
index 332ea13..f4a2236 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFnTester.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFnTester.java
@@ -56,18 +56,18 @@ import java.util.Map;
  *
  * DoFnTester<InputT, OutputT> fnTester = DoFnTester.of(fn);
  *
- * // Set arguments shared across all batches:
+ * // Set arguments shared across all bundles:
  * fnTester.setSideInputs(...);      // If fn takes side inputs.
  * fnTester.setSideOutputTags(...);  // If fn writes to side outputs.
  *
- * // Process a batch containing a single input element:
+ * // Process a bundle containing a single input element:
  * Input testInput = ...;
- * List<OutputT> testOutputs = fnTester.processBatch(testInput);
+ * List<OutputT> testOutputs = fnTester.processBundle(testInput);
  * Assert.assertThat(testOutputs,
  *                   JUnitMatchers.hasItems(...));
  *
- * // Process a bigger batch:
- * Assert.assertThat(fnTester.processBatch(i1, i2, ...),
+ * // Process a bigger bundle:
+ * Assert.assertThat(fnTester.processBundle(i1, i2, ...),
  *                   JUnitMatchers.hasItems(...));
  * } </pre>
  *
@@ -163,7 +163,7 @@ public class DoFnTester<InputT, OutputT> {
    * calls {@link #finishBundle}, then returns the result of
    * {@link #takeOutputElements}.
    */
-  public List<OutputT> processBatch(Iterable <? extends InputT> inputElements)
throws Exception {
+  public List<OutputT> processBundle(Iterable <? extends InputT> inputElements)
throws Exception {
     startBundle();
     for (InputT inputElement : inputElements) {
       processElement(inputElement);
@@ -184,8 +184,8 @@ public class DoFnTester<InputT, OutputT> {
    * </ol>
    */
   @SafeVarargs
-  public final List<OutputT> processBatch(InputT... inputElements) throws Exception
{
-    return processBatch(Arrays.asList(inputElements));
+  public final List<OutputT> processBundle(InputT... inputElements) throws Exception
{
+    return processBundle(Arrays.asList(inputElements));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/DoFnTesterTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/DoFnTesterTest.java
b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/DoFnTesterTest.java
index ec22251..c6e97a5 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/DoFnTesterTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/DoFnTesterTest.java
@@ -123,8 +123,8 @@ public class DoFnTesterTest {
     CounterDoFn counterDoFn = new CounterDoFn();
     DoFnTester<Long, String> tester = DoFnTester.of(counterDoFn);
 
-    // processBatch() returns all the output like takeOutputElements().
-    List<String> take = tester.processBatch(1L, 2L, 3L, 4L);
+    // processBundle() returns all the output like takeOutputElements().
+    List<String> take = tester.processBundle(1L, 2L, 3L, 4L);
 
     assertThat(take, hasItems("1", "2", "3", "4"));
 
@@ -178,7 +178,7 @@ public class DoFnTesterTest {
   public void getAggregatorValuesShouldGetValueOfCounter() throws Exception {
     CounterDoFn counterDoFn = new CounterDoFn();
     DoFnTester<Long, String> tester = DoFnTester.of(counterDoFn);
-    tester.processBatch(1L, 2L, 4L, 8L);
+    tester.processBundle(1L, 2L, 4L, 8L);
 
     Long aggregatorVal = tester.getAggregatorValue(counterDoFn.agg);
 
@@ -189,7 +189,7 @@ public class DoFnTesterTest {
   public void getAggregatorValuesWithEmptyCounterShouldSucceed() throws Exception {
     CounterDoFn counterDoFn = new CounterDoFn();
     DoFnTester<Long, String> tester = DoFnTester.of(counterDoFn);
-    tester.processBatch();
+    tester.processBundle();
     Long aggregatorVal = tester.getAggregatorValue(counterDoFn.agg);
     // empty bundle
     assertThat(aggregatorVal, equalTo(0L));
@@ -199,7 +199,7 @@ public class DoFnTesterTest {
   public void getAggregatorValuesInStartFinishBundleShouldGetValues() throws Exception {
     CounterDoFn fn = new CounterDoFn(1L, 2L);
     DoFnTester<Long, String> tester = DoFnTester.of(fn);
-    tester.processBatch(0L, 0L);
+    tester.processBundle(0L, 0L);
 
     Long aggValue = tester.getAggregatorValue(fn.agg);
     assertThat(aggValue, equalTo(1L + 2L));

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/join/CoGroupByKeyTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/join/CoGroupByKeyTest.java
b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/join/CoGroupByKeyTest.java
index d99c536..10a2a7e 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/join/CoGroupByKeyTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/join/CoGroupByKeyTest.java
@@ -438,7 +438,7 @@ public class CoGroupByKeyTest implements Serializable {
                 purchasesTag,
                 addressesTag,
                 namesTag))
-                .processBatch(
+                .processBundle(
                     KV.of(1, result1),
                     KV.of(2, result2),
                     KV.of(3, result3),

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/43f3aa30/sdks/java/maven-archetypes/examples/src/main/resources/archetype-resources/src/test/java/WordCountTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/maven-archetypes/examples/src/main/resources/archetype-resources/src/test/java/WordCountTest.java
b/sdks/java/maven-archetypes/examples/src/main/resources/archetype-resources/src/test/java/WordCountTest.java
index 4b26198..debfc78 100644
--- a/sdks/java/maven-archetypes/examples/src/main/resources/archetype-resources/src/test/java/WordCountTest.java
+++ b/sdks/java/maven-archetypes/examples/src/main/resources/archetype-resources/src/test/java/WordCountTest.java
@@ -52,11 +52,11 @@ public class WordCountTest {
     DoFnTester<String, String> extractWordsFn =
         DoFnTester.of(new ExtractWordsFn());
 
-    Assert.assertThat(extractWordsFn.processBatch(" some  input  words "),
+    Assert.assertThat(extractWordsFn.processBundle(" some  input  words "),
                       CoreMatchers.hasItems("some", "input", "words"));
-    Assert.assertThat(extractWordsFn.processBatch(" "),
+    Assert.assertThat(extractWordsFn.processBundle(" "),
                       CoreMatchers.<String>hasItems());
-    Assert.assertThat(extractWordsFn.processBatch(" some ", " input", " words"),
+    Assert.assertThat(extractWordsFn.processBundle(" some ", " input", " words"),
                       CoreMatchers.hasItems("some", "input", "words"));
   }
 


Mime
View raw message