use of org.apache.beam.runners.dataflow.worker.options.StreamingDataflowWorkerOptions in project beam by apache.
the class StreamingDataflowWorkerTest method testActiveWorkRefresh.
@Test
public void testActiveWorkRefresh() throws Exception {
if (streamingEngine) {
// TODO: This test needs to be adapted to work with streamingEngine=true.
return;
}
List<ParallelInstruction> instructions = Arrays.asList(makeSourceInstruction(StringUtf8Coder.of()), makeDoFnInstruction(new SlowDoFn(), 0, StringUtf8Coder.of()), makeSinkInstruction(StringUtf8Coder.of(), 0));
FakeWindmillServer server = new FakeWindmillServer(errorCollector);
StreamingDataflowWorkerOptions options = createTestingPipelineOptions(server);
options.setActiveWorkRefreshPeriodMillis(100);
StreamingDataflowWorker worker = makeWorker(instructions, options, true);
worker.start();
server.addWorkToOffer(makeInput(0, TimeUnit.MILLISECONDS.toMicros(0)));
server.waitForAndGetCommits(1);
worker.stop();
// This graph will not normally produce any GetData calls, so all such calls are from active
// work refreshes.
assertThat(server.numGetDataRequests(), greaterThan(0));
}
use of org.apache.beam.runners.dataflow.worker.options.StreamingDataflowWorkerOptions in project beam by apache.
the class StreamingDataflowWorkerTest method testHugeCommits.
@Test
public void testHugeCommits() throws Exception {
List<ParallelInstruction> instructions = Arrays.asList(makeSourceInstruction(StringUtf8Coder.of()), makeDoFnInstruction(new FanoutFn(), 0, StringUtf8Coder.of()), makeSinkInstruction(StringUtf8Coder.of(), 0));
FakeWindmillServer server = new FakeWindmillServer(errorCollector);
StreamingDataflowWorkerOptions options = createTestingPipelineOptions(server);
StreamingDataflowWorker worker = makeWorker(instructions, options, true);
worker.start();
server.addWorkToOffer(makeInput(0, TimeUnit.MILLISECONDS.toMicros(0)));
server.waitForAndGetCommits(0);
worker.stop();
}
Aggregations