Search in sources :

Example 1 with BoundedSourceSplit

use of org.apache.beam.runners.dataflow.worker.WorkerCustomSources.BoundedSourceSplit in project beam by apache.

the class WorkItemStatusClientTest method populateSplitResultCustomReader.

@Test
public void populateSplitResultCustomReader() throws Exception {
    WorkItemStatus status = new WorkItemStatus();
    statusClient.setWorker(worker, executionContext);
    BoundedSource<Integer> primary = new DummyBoundedSource(5);
    BoundedSource<Integer> residual = new DummyBoundedSource(10);
    BoundedSourceSplit<Integer> split = new BoundedSourceSplit<>(primary, residual);
    statusClient.populateSplitResult(status, split);
    assertThat(status.getDynamicSourceSplit(), equalTo(WorkerCustomSources.toSourceSplit(split)));
    assertThat(status.getStopPosition(), nullValue());
}
Also used : WorkItemStatus(com.google.api.services.dataflow.model.WorkItemStatus) BoundedSourceSplit(org.apache.beam.runners.dataflow.worker.WorkerCustomSources.BoundedSourceSplit) Test(org.junit.Test)

Aggregations

WorkItemStatus (com.google.api.services.dataflow.model.WorkItemStatus)1 BoundedSourceSplit (org.apache.beam.runners.dataflow.worker.WorkerCustomSources.BoundedSourceSplit)1 Test (org.junit.Test)1