Replaces fromTo() with from().to()
Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/dffa6a88 Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/dffa6a88 Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/dffa6a88 Branch: refs/heads/master Commit: dffa6a8832c5ead67a398e0787f7137f9f15fa1f Parents: 57eeaae Author: Eugene Kirpichov <kirpic...@google.com> Authored: Fri Apr 21 15:18:18 2017 -0700 Committer: Eugene Kirpichov <kirpic...@google.com> Committed: Fri Apr 21 16:53:50 2017 -0700 ---------------------------------------------------------------------- .../translation/ReadUnboundTranslatorTest.java | 2 +- .../EmptyFlattenAsCreateFactoryTest.java | 2 +- .../core/construction/PCollectionsTest.java | 2 +- .../beam/runners/direct/DirectRunnerTest.java | 2 +- .../beam/runners/flink/ReadSourceITCase.java | 2 +- .../runners/flink/ReadSourceStreamingITCase.java | 2 +- .../streaming/StreamingSourceMetricsTest.java | 2 +- .../org/apache/beam/sdk/io/GenerateSequence.java | 5 ----- .../org/apache/beam/sdk/values/PCollection.java | 8 ++++---- .../java/org/apache/beam/sdk/PipelineTest.java | 2 +- .../apache/beam/sdk/io/GenerateSequenceTest.java | 18 +++++++++--------- .../org/apache/beam/sdk/metrics/MetricsTest.java | 4 ++-- .../beam/sdk/testing/GatherAllPanesTest.java | 6 +++--- .../org/apache/beam/sdk/testing/PAssertTest.java | 8 ++++---- .../apache/beam/sdk/transforms/FlattenTest.java | 6 +++--- .../beam/sdk/transforms/windowing/WindowTest.java | 2 +- .../beam/sdk/values/PCollectionListTest.java | 2 +- .../beam/sdk/values/PCollectionTupleTest.java | 2 +- .../beam/sdk/io/gcp/bigtable/BigtableWriteIT.java | 2 +- .../beam/sdk/io/gcp/datastore/V1WriteIT.java | 2 +- 20 files changed, 38 insertions(+), 43 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/runners/apex/src/test/java/org/apache/beam/runners/apex/translation/ReadUnboundTranslatorTest.java ---------------------------------------------------------------------- diff --git a/runners/apex/src/test/java/org/apache/beam/runners/apex/translation/ReadUnboundTranslatorTest.java b/runners/apex/src/test/java/org/apache/beam/runners/apex/translation/ReadUnboundTranslatorTest.java index e0cc251..6f54e23 100644 --- a/runners/apex/src/test/java/org/apache/beam/runners/apex/translation/ReadUnboundTranslatorTest.java +++ b/runners/apex/src/test/java/org/apache/beam/runners/apex/translation/ReadUnboundTranslatorTest.java @@ -92,7 +92,7 @@ public class ReadUnboundTranslatorTest { Pipeline p = Pipeline.create(options); Set<Long> expected = ContiguousSet.create(Range.closedOpen(0L, 10L), DiscreteDomain.longs()); - p.apply(GenerateSequence.fromTo(0, 10)) + p.apply(GenerateSequence.from(0).to(10)) .apply(ParDo.of(new EmbeddedCollector())); ApexRunnerResult result = (ApexRunnerResult) p.run(); http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/EmptyFlattenAsCreateFactoryTest.java ---------------------------------------------------------------------- diff --git a/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/EmptyFlattenAsCreateFactoryTest.java b/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/EmptyFlattenAsCreateFactoryTest.java index bfa3190..c388878 100644 --- a/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/EmptyFlattenAsCreateFactoryTest.java +++ b/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/EmptyFlattenAsCreateFactoryTest.java @@ -72,7 +72,7 @@ public class EmptyFlattenAsCreateFactoryTest { public void getInputNonEmptyThrows() { PCollectionList<Long> nonEmpty = PCollectionList.of(pipeline.apply("unbounded", GenerateSequence.from(0))) - .and(pipeline.apply("bounded", GenerateSequence.fromTo(0, 100))); + .and(pipeline.apply("bounded", GenerateSequence.from(0).to(100))); thrown.expect(IllegalArgumentException.class); thrown.expectMessage(nonEmpty.expand().toString()); thrown.expectMessage(EmptyFlattenAsCreateFactory.class.getSimpleName()); http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/PCollectionsTest.java ---------------------------------------------------------------------- diff --git a/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/PCollectionsTest.java b/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/PCollectionsTest.java index 48aa1f1..be3755c 100644 --- a/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/PCollectionsTest.java +++ b/runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/PCollectionsTest.java @@ -83,7 +83,7 @@ public class PCollectionsTest { .apply("group", GroupByKey.<String, String>create()); PCollection<Long> coderLongs = pipeline - .apply("counts with alternative coder", GenerateSequence.fromTo(0, 10)) + .apply("counts with alternative coder", GenerateSequence.from(0).to(10)) .setCoder(BigEndianLongCoder.of()); PCollection<Integer> allCustomInts = pipeline http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerTest.java ---------------------------------------------------------------------- diff --git a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerTest.java b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerTest.java index f9063f0..86d7f05 100644 --- a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerTest.java +++ b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerTest.java @@ -513,7 +513,7 @@ public class DirectRunnerTest implements Serializable { @Test public void testUnencodableOutputFromBoundedRead() throws Exception { Pipeline p = getPipeline(); - p.apply(GenerateSequence.fromTo(0, 10)).setCoder(new LongNoDecodeCoder()); + p.apply(GenerateSequence.from(0).to(10)).setCoder(new LongNoDecodeCoder()); thrown.expectCause(isA(CoderException.class)); thrown.expectMessage("Cannot decode a long"); http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/runners/flink/src/test/java/org/apache/beam/runners/flink/ReadSourceITCase.java ---------------------------------------------------------------------- diff --git a/runners/flink/src/test/java/org/apache/beam/runners/flink/ReadSourceITCase.java b/runners/flink/src/test/java/org/apache/beam/runners/flink/ReadSourceITCase.java index 8302983..65d198e 100644 --- a/runners/flink/src/test/java/org/apache/beam/runners/flink/ReadSourceITCase.java +++ b/runners/flink/src/test/java/org/apache/beam/runners/flink/ReadSourceITCase.java @@ -68,7 +68,7 @@ public class ReadSourceITCase extends JavaProgramTestBase { Pipeline p = FlinkTestPipeline.createForBatch(); PCollection<String> result = p - .apply(GenerateSequence.fromTo(0, 10)) + .apply(GenerateSequence.from(0).to(10)) .apply(ParDo.of(new DoFn<Long, String>() { @ProcessElement public void processElement(ProcessContext c) throws Exception { http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/runners/flink/src/test/java/org/apache/beam/runners/flink/ReadSourceStreamingITCase.java ---------------------------------------------------------------------- diff --git a/runners/flink/src/test/java/org/apache/beam/runners/flink/ReadSourceStreamingITCase.java b/runners/flink/src/test/java/org/apache/beam/runners/flink/ReadSourceStreamingITCase.java index c7a044e..4f597c3 100644 --- a/runners/flink/src/test/java/org/apache/beam/runners/flink/ReadSourceStreamingITCase.java +++ b/runners/flink/src/test/java/org/apache/beam/runners/flink/ReadSourceStreamingITCase.java @@ -58,7 +58,7 @@ public class ReadSourceStreamingITCase extends StreamingProgramTestBase { Pipeline p = FlinkTestPipeline.createForStreaming(); p - .apply(GenerateSequence.fromTo(0, 10)) + .apply(GenerateSequence.from(0).to(10)) .apply(ParDo.of(new DoFn<Long, String>() { @ProcessElement public void processElement(ProcessContext c) throws Exception { http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/runners/spark/src/test/java/org/apache/beam/runners/spark/translation/streaming/StreamingSourceMetricsTest.java ---------------------------------------------------------------------- diff --git a/runners/spark/src/test/java/org/apache/beam/runners/spark/translation/streaming/StreamingSourceMetricsTest.java b/runners/spark/src/test/java/org/apache/beam/runners/spark/translation/streaming/StreamingSourceMetricsTest.java index 85fdf72..80f7f53 100644 --- a/runners/spark/src/test/java/org/apache/beam/runners/spark/translation/streaming/StreamingSourceMetricsTest.java +++ b/runners/spark/src/test/java/org/apache/beam/runners/spark/translation/streaming/StreamingSourceMetricsTest.java @@ -56,7 +56,7 @@ public class StreamingSourceMetricsTest implements Serializable { pipeline.apply( // Use maxReadTime to force unbounded mode. - GenerateSequence.fromTo(0, numElements).withMaxReadTime(Duration.standardDays(1))); + GenerateSequence.from(0).to(numElements).withMaxReadTime(Duration.standardDays(1))); PipelineResult pipelineResult = pipeline.run(); http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/core/src/main/java/org/apache/beam/sdk/io/GenerateSequence.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/GenerateSequence.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/GenerateSequence.java index 8a83d39..189539f 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/GenerateSequence.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/GenerateSequence.java @@ -109,11 +109,6 @@ public abstract class GenerateSequence extends PTransform<PBegin, PCollection<Lo .build(); } - /** Specifies to generate the range [from, to). */ - public static GenerateSequence fromTo(long from, long to) { - return from(from).to(to); - } - /** Specifies the maximum number to generate (exclusive). */ public GenerateSequence to(long to) { checkArgument( http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollection.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollection.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollection.java index f89d2aa..67520ce 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollection.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollection.java @@ -39,10 +39,10 @@ import org.apache.beam.sdk.util.WindowingStrategy; * be passed as the inputs of other PTransforms. * * <p>Some root transforms produce bounded {@code PCollections} and others - * produce unbounded ones. For example, {@link GenerateSequence#fromTo} produces a fixed set of - * integers, so it produces a bounded {@link PCollection}. {@link GenerateSequence#from} without - * a {@link GenerateSequence#to} produces all integers as an infinite stream, so it produces an - * unbounded {@link PCollection}. + * produce unbounded ones. For example, {@link GenerateSequence#from} with + * {@link GenerateSequence#to} produces a fixed set of integers, so it produces a bounded + * {@link PCollection}. {@link GenerateSequence#from} without a {@link GenerateSequence#to} + * produces all integers as an infinite stream, so it produces an unbounded {@link PCollection}. * * <p>Each element in a {@link PCollection} has an associated timestamp. Readers assign timestamps * to elements when they create {@link PCollection PCollections}, and other http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/core/src/test/java/org/apache/beam/sdk/PipelineTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/PipelineTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/PipelineTest.java index 9604c3f..af629a6 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/PipelineTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/PipelineTest.java @@ -316,7 +316,7 @@ public class PipelineTest { public void testReplaceAll() { pipeline.enableAbandonedNodeEnforcement(false); pipeline.apply("unbounded", GenerateSequence.from(0)); - pipeline.apply("bounded", GenerateSequence.fromTo(0, 100)); + pipeline.apply("bounded", GenerateSequence.from(0).to(100)); pipeline.replaceAll( ImmutableList.of( http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/core/src/test/java/org/apache/beam/sdk/io/GenerateSequenceTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/io/GenerateSequenceTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/io/GenerateSequenceTest.java index e2c185b..49af479 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/io/GenerateSequenceTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/io/GenerateSequenceTest.java @@ -65,7 +65,7 @@ public class GenerateSequenceTest { @Category(ValidatesRunner.class) public void testBoundedInput() { long numElements = 1000; - PCollection<Long> input = p.apply(GenerateSequence.fromTo(0, numElements)); + PCollection<Long> input = p.apply(GenerateSequence.from(0).to(numElements)); addCountingAsserts(input, 0, numElements); p.run(); @@ -74,7 +74,7 @@ public class GenerateSequenceTest { @Test @Category(ValidatesRunner.class) public void testEmptyBoundedInput() { - PCollection<Long> input = p.apply(GenerateSequence.fromTo(0, 0)); + PCollection<Long> input = p.apply(GenerateSequence.from(0).to(0)); PAssert.that(input).empty(); p.run(); @@ -83,7 +83,7 @@ public class GenerateSequenceTest { @Test @Category(ValidatesRunner.class) public void testEmptyBoundedInputSubrange() { - PCollection<Long> input = p.apply(GenerateSequence.fromTo(42, 42)); + PCollection<Long> input = p.apply(GenerateSequence.from(42).to(42)); PAssert.that(input).empty(); p.run(); @@ -94,7 +94,7 @@ public class GenerateSequenceTest { public void testBoundedInputSubrange() { long start = 10; long end = 1000; - PCollection<Long> input = p.apply(GenerateSequence.fromTo(start, end)); + PCollection<Long> input = p.apply(GenerateSequence.from(start).to(end)); addCountingAsserts(input, start, end); p.run(); @@ -102,7 +102,7 @@ public class GenerateSequenceTest { @Test public void testBoundedDisplayData() { - PTransform<?, ?> input = GenerateSequence.fromTo(0, 1234); + PTransform<?, ?> input = GenerateSequence.from(0).to(1234); DisplayData displayData = DisplayData.from(input); assertThat(displayData, hasDisplayItem("from", 0)); assertThat(displayData, hasDisplayItem("to", 1234)); @@ -110,7 +110,7 @@ public class GenerateSequenceTest { @Test public void testBoundedDisplayDataSubrange() { - PTransform<?, ?> input = GenerateSequence.fromTo(12, 1234); + PTransform<?, ?> input = GenerateSequence.from(12).to(1234); DisplayData displayData = DisplayData.from(input); assertThat(displayData, hasDisplayItem("from", 12)); assertThat(displayData, hasDisplayItem("to", 1234)); @@ -124,7 +124,7 @@ public class GenerateSequenceTest { long elemsPerPeriod = 10L; Duration periodLength = Duration.millis(8); PCollection<Long> input = - p.apply(GenerateSequence.fromTo(0, numElements).withRate(elemsPerPeriod, periodLength)); + p.apply(GenerateSequence.from(0).to(numElements).withRate(elemsPerPeriod, periodLength)); addCountingAsserts(input, 0, numElements); long expectedRuntimeMillis = (periodLength.getMillis() * numElements) / elemsPerPeriod; @@ -147,7 +147,7 @@ public class GenerateSequenceTest { long numElements = 1000; PCollection<Long> input = - p.apply(GenerateSequence.fromTo(0, numElements).withTimestampFn(new ValueAsTimestampFn())); + p.apply(GenerateSequence.from(0).to(numElements).withTimestampFn(new ValueAsTimestampFn())); addCountingAsserts(input, 0, numElements); PCollection<Long> diffs = @@ -172,7 +172,7 @@ public class GenerateSequenceTest { }; PTransform<?, ?> input = - GenerateSequence.fromTo(0, 1234).withMaxReadTime(maxReadTime).withTimestampFn(timestampFn); + GenerateSequence.from(0).to(1234).withMaxReadTime(maxReadTime).withTimestampFn(timestampFn); DisplayData displayData = DisplayData.from(input); http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/core/src/test/java/org/apache/beam/sdk/metrics/MetricsTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/metrics/MetricsTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/metrics/MetricsTest.java index 312a433..a093e89 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/metrics/MetricsTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/metrics/MetricsTest.java @@ -236,7 +236,7 @@ public class MetricsTest implements Serializable { public void testBoundedSourceMetrics() { long numElements = 1000; - pipeline.apply(GenerateSequence.fromTo(0, numElements)); + pipeline.apply(GenerateSequence.from(0).to(numElements)); PipelineResult pipelineResult = pipeline.run(); @@ -260,7 +260,7 @@ public class MetricsTest implements Serializable { // Use withMaxReadTime to force unbounded mode. pipeline.apply( - GenerateSequence.fromTo(0, numElements).withMaxReadTime(Duration.standardDays(1))); + GenerateSequence.from(0).to(numElements).withMaxReadTime(Duration.standardDays(1))); PipelineResult pipelineResult = pipeline.run(); http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/GatherAllPanesTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/GatherAllPanesTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/GatherAllPanesTest.java index b546158..c90ac27 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/GatherAllPanesTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/GatherAllPanesTest.java @@ -54,7 +54,7 @@ public class GatherAllPanesTest implements Serializable { @Category(NeedsRunner.class) public void singlePaneSingleReifiedPane() { PCollection<Iterable<ValueInSingleWindow<Iterable<Long>>>> accumulatedPanes = - p.apply(GenerateSequence.fromTo(0, 20000)) + p.apply(GenerateSequence.from(0).to(20000)) .apply( WithTimestamps.of( new SerializableFunction<Long, Instant>() { @@ -95,8 +95,8 @@ public class GatherAllPanesTest implements Serializable { @Test @Category(NeedsRunner.class) public void multiplePanesMultipleReifiedPane() { - PCollection<Long> someElems = p.apply("someLongs", GenerateSequence.fromTo(0, 20000)); - PCollection<Long> otherElems = p.apply("otherLongs", GenerateSequence.fromTo(0, 20000)); + PCollection<Long> someElems = p.apply("someLongs", GenerateSequence.from(0).to(20000)); + PCollection<Long> otherElems = p.apply("otherLongs", GenerateSequence.from(0).to(20000)); PCollection<Iterable<ValueInSingleWindow<Iterable<Long>>>> accumulatedPanes = PCollectionList.of(someElems) .and(otherElems) http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/PAssertTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/PAssertTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/PAssertTest.java index a5362b1..9d580e4 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/PAssertTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/PAssertTest.java @@ -425,7 +425,7 @@ public class PAssertTest implements Serializable { @Test @Category(ValidatesRunner.class) public void testEmptyFalse() throws Exception { - PCollection<Long> vals = pipeline.apply(GenerateSequence.fromTo(0, 5)); + PCollection<Long> vals = pipeline.apply(GenerateSequence.from(0).to(5)); PAssert.that("Vals should have been empty", vals).empty(); Throwable thrown = runExpectingAssertionFailure(pipeline); @@ -439,7 +439,7 @@ public class PAssertTest implements Serializable { @Test @Category(ValidatesRunner.class) public void testEmptyFalseDefaultReasonString() throws Exception { - PCollection<Long> vals = pipeline.apply(GenerateSequence.fromTo(0, 5)); + PCollection<Long> vals = pipeline.apply(GenerateSequence.from(0).to(5)); PAssert.that(vals).empty(); Throwable thrown = runExpectingAssertionFailure(pipeline); @@ -454,7 +454,7 @@ public class PAssertTest implements Serializable { @Test @Category(ValidatesRunner.class) public void testAssertionSiteIsCapturedWithMessage() throws Exception { - PCollection<Long> vals = pipeline.apply(GenerateSequence.fromTo(0, 5)); + PCollection<Long> vals = pipeline.apply(GenerateSequence.from(0).to(5)); assertThatCollectionIsEmptyWithMessage(vals); Throwable thrown = runExpectingAssertionFailure(pipeline); @@ -473,7 +473,7 @@ public class PAssertTest implements Serializable { @Test @Category(ValidatesRunner.class) public void testAssertionSiteIsCapturedWithoutMessage() throws Exception { - PCollection<Long> vals = pipeline.apply(GenerateSequence.fromTo(0, 5)); + PCollection<Long> vals = pipeline.apply(GenerateSequence.from(0).to(5)); assertThatCollectionIsEmptyWithoutMessage(vals); Throwable thrown = runExpectingAssertionFailure(pipeline); http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/FlattenTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/FlattenTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/FlattenTest.java index fca804b..a8cb843 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/FlattenTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/FlattenTest.java @@ -138,9 +138,9 @@ public class FlattenTest implements Serializable { @Category(ValidatesRunner.class) public void testFlattenInputMultipleCopies() { int count = 5; - PCollection<Long> longs = p.apply("mkLines", GenerateSequence.fromTo(0, count)); + PCollection<Long> longs = p.apply("mkLines", GenerateSequence.from(0).to(count)); PCollection<Long> biggerLongs = - p.apply("mkOtherLines", GenerateSequence.fromTo(0, count)) + p.apply("mkOtherLines", GenerateSequence.from(0).to(count)) .apply( MapElements.via( new SimpleFunction<Long, Long>() { @@ -175,7 +175,7 @@ public class FlattenTest implements Serializable { Create.of(0L, 1L, 2L, 3L, null, 4L, 5L, null, 6L, 7L, 8L, null, 9L) .withCoder(NullableCoder.of(BigEndianLongCoder.of()))); PCollection<Long> varLongs = - p.apply("VarLengthLongs", GenerateSequence.fromTo(0, 5)).setCoder(VarLongCoder.of()); + p.apply("VarLengthLongs", GenerateSequence.from(0).to(5)).setCoder(VarLongCoder.of()); PCollection<Long> flattened = PCollectionList.of(bigEndianLongs) http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/windowing/WindowTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/windowing/WindowTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/windowing/WindowTest.java index 9fe7ec3..e1ed66a 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/windowing/WindowTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/windowing/WindowTest.java @@ -319,7 +319,7 @@ public class WindowTest implements Serializable { final PCollection<Long> initialWindows = pipeline - .apply(GenerateSequence.fromTo(0, 10)) + .apply(GenerateSequence.from(0).to(10)) .apply("AssignWindows", Window.into(new WindowOddEvenBuckets())); // Sanity check the window assignment to demonstrate the baseline http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionListTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionListTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionListTest.java index f687637..f9fa06d 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionListTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionListTest.java @@ -62,7 +62,7 @@ public class PCollectionListTest { public void testIterationOrder() { Pipeline p = TestPipeline.create(); PCollection<Long> createOne = p.apply("CreateOne", Create.of(1L, 2L, 3L)); - PCollection<Long> boundedCount = p.apply("CountBounded", GenerateSequence.fromTo(0, 23)); + PCollection<Long> boundedCount = p.apply("CountBounded", GenerateSequence.from(0).to(23)); PCollection<Long> unboundedCount = p.apply("CountUnbounded", GenerateSequence.from(0)); PCollection<Long> createTwo = p.apply("CreateTwo", Create.of(-1L, -2L)); PCollection<Long> maxReadTimeCount = http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionTupleTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionTupleTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionTupleTest.java index cc8761b..b704d07 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionTupleTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionTupleTest.java @@ -135,7 +135,7 @@ public final class PCollectionTupleTest implements Serializable { TupleTag<Long> longTag = new TupleTag<>(); Pipeline p = TestPipeline.create(); - PCollection<Long> longs = p.apply(GenerateSequence.fromTo(0, 100)); + PCollection<Long> longs = p.apply(GenerateSequence.from(0).to(100)); PCollection<String> strs = p.apply(Create.of("foo", "bar", "baz")); PCollection<Integer> ints = longs.apply(MapElements.via(new SimpleFunction<Long, Integer>() { @Override http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteIT.java ---------------------------------------------------------------------- diff --git a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteIT.java b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteIT.java index 4ba77c9..447e181 100644 --- a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteIT.java +++ b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteIT.java @@ -106,7 +106,7 @@ public class BigtableWriteIT implements Serializable { createEmptyTable(instanceName, tableId); Pipeline p = Pipeline.create(options); - p.apply(GenerateSequence.fromTo(0, numRows)) + p.apply(GenerateSequence.from(0).to(numRows)) .apply(ParDo.of(new DoFn<Long, KV<ByteString, Iterable<Mutation>>>() { @ProcessElement public void processElement(ProcessContext c) { http://git-wip-us.apache.org/repos/asf/beam/blob/dffa6a88/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/datastore/V1WriteIT.java ---------------------------------------------------------------------- diff --git a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/datastore/V1WriteIT.java b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/datastore/V1WriteIT.java index 322aecd..bd5a80b 100644 --- a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/datastore/V1WriteIT.java +++ b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/datastore/V1WriteIT.java @@ -66,7 +66,7 @@ public class V1WriteIT { Pipeline p = Pipeline.create(options); // Write to datastore - p.apply(GenerateSequence.fromTo(0, numEntities)) + p.apply(GenerateSequence.from(0).to(numEntities)) .apply(ParDo.of(new CreateEntityFn( options.getKind(), options.getNamespace(), ancestor))) .apply(DatastoreIO.v1().write().withProjectId(project));