Search in sources :

Example 1 with Progress

use of org.apache.beam.runners.dataflow.worker.util.common.worker.NativeReader.Progress in project beam by apache.

the class WorkItemStatusClientTest method populateProgress.

@Test
public void populateProgress() throws Exception {
    WorkItemStatus status = new WorkItemStatus();
    Progress progress = cloudProgressToReaderProgress(ReaderTestUtils.approximateProgressAtIndex(42L));
    when(worker.getWorkerProgress()).thenReturn(progress);
    statusClient.setWorker(worker, executionContext);
    statusClient.populateProgress(status);
    assertThat(status.getReportedProgress(), equalTo(ReaderTestUtils.approximateProgressAtIndex(42L)));
}
Also used : SourceTranslationUtils.cloudProgressToReaderProgress(org.apache.beam.runners.dataflow.worker.SourceTranslationUtils.cloudProgressToReaderProgress) Progress(org.apache.beam.runners.dataflow.worker.util.common.worker.NativeReader.Progress) WorkItemStatus(com.google.api.services.dataflow.model.WorkItemStatus) Test(org.junit.Test)

Aggregations

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