Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #428 from peihe/disable-unbounded-read
Browse files Browse the repository at this point in the history
Revert PR-427 to re-enable streaming bounded read
  • Loading branch information
dhalperi authored Sep 9, 2016
2 parents a7e516d + bf6fed3 commit d47c1e6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,7 @@ public static DataflowPipelineRunner fromOptions(PipelineOptions options) {
builder.put(View.AsList.class, StreamingViewAsList.class);
builder.put(View.AsIterable.class, StreamingViewAsIterable.class);
builder.put(Read.Unbounded.class, StreamingUnboundedRead.class);
if (options.getExperiments() == null
|| !options.getExperiments().contains("enable_streaming_bounded_read")) {
builder.put(Read.Bounded.class, UnsupportedIO.class);
builder.put(AvroIO.Read.Bound.class, UnsupportedIO.class);
builder.put(BigQueryIO.Read.Bound.class, UnsupportedIO.class);
builder.put(TextIO.Read.Bound.class, UnsupportedIO.class);
} else {
builder.put(Read.Bounded.class, StreamingBoundedRead.class);
}
builder.put(Read.Bounded.class, StreamingBoundedRead.class);
builder.put(AvroIO.Write.Bound.class, UnsupportedIO.class);
builder.put(Window.Bound.class, AssignWindows.class);
// In streaming mode must use either the custom Pubsub unbounded source/sink or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
import com.google.cloud.dataflow.sdk.coders.Coder;
import com.google.cloud.dataflow.sdk.coders.VarLongCoder;
import com.google.cloud.dataflow.sdk.io.AvroIO;
import com.google.cloud.dataflow.sdk.io.AvroSource;
import com.google.cloud.dataflow.sdk.io.BigQueryIO;
import com.google.cloud.dataflow.sdk.io.Read;
import com.google.cloud.dataflow.sdk.io.TextIO;
import com.google.cloud.dataflow.sdk.options.DataflowPipelineDebugOptions;
Expand Down Expand Up @@ -930,33 +928,6 @@ private void testUnsupportedSource(PTransform<PInput, ?> source, String name, bo
p.run();
}

@Test
public void testBoundedSourceUnsupportedInStreaming() throws Exception {
testUnsupportedSource(
AvroSource.readFromFileWithClass("foo", String.class), "Read.Bounded", true);
}

@Test
public void testBigQueryIOSourceUnsupportedInStreaming() throws Exception {
testUnsupportedSource(
BigQueryIO.Read.from("project:bar.baz").withoutValidation(), "BigQueryIO.Read", true);
}

@Test
public void testAvroIOSourceUnsupportedInStreaming() throws Exception {
testUnsupportedSource(AvroIO.Read.from("foo"), "AvroIO.Read", true);
}

@Test
public void testTextIOSourceUnsupportedInStreaming() throws Exception {
testUnsupportedSource(TextIO.Read.from("foo"), "TextIO.Read", true);
}

@Test
public void testReadBoundedSourceUnsupportedInStreaming() throws Exception {
testUnsupportedSource(Read.from(AvroSource.from("/tmp/test")), "Read.Bounded", true);
}

@Test
public void testReadUnboundedUnsupportedInBatch() throws Exception {
testUnsupportedSource(Read.from(new TestCountingSource(1)), "Read.Unbounded", false);
Expand Down

0 comments on commit d47c1e6

Please sign in to comment.