Search in sources :

Example 1 with DataflowReaderPosition

use of org.apache.beam.runners.dataflow.worker.SourceTranslationUtils.DataflowReaderPosition in project beam by apache.

the class WorkItemStatusClientTest method populateSplitResultNativeReader.

@Test
public void populateSplitResultNativeReader() throws Exception {
    WorkItemStatus status = new WorkItemStatus();
    statusClient.setWorker(worker, executionContext);
    Position position = ReaderTestUtils.positionAtIndex(42L);
    DynamicSplitResult result = new NativeReader.DynamicSplitResultWithPosition(new DataflowReaderPosition(position));
    statusClient.populateSplitResult(status, result);
    assertThat(status.getStopPosition(), equalTo(position));
    assertThat(status.getDynamicSourceSplit(), nullValue());
}
Also used : WorkItemStatus(com.google.api.services.dataflow.model.WorkItemStatus) DataflowReaderPosition(org.apache.beam.runners.dataflow.worker.SourceTranslationUtils.DataflowReaderPosition) Position(com.google.api.services.dataflow.model.Position) DataflowReaderPosition(org.apache.beam.runners.dataflow.worker.SourceTranslationUtils.DataflowReaderPosition) DynamicSplitResult(org.apache.beam.runners.dataflow.worker.util.common.worker.NativeReader.DynamicSplitResult) Test(org.junit.Test)

Aggregations

Position (com.google.api.services.dataflow.model.Position)1 WorkItemStatus (com.google.api.services.dataflow.model.WorkItemStatus)1 DataflowReaderPosition (org.apache.beam.runners.dataflow.worker.SourceTranslationUtils.DataflowReaderPosition)1 DynamicSplitResult (org.apache.beam.runners.dataflow.worker.util.common.worker.NativeReader.DynamicSplitResult)1 Test (org.junit.Test)1