Search in sources :

Example 6 with OffsetRangeTracker

use of org.apache.beam.sdk.transforms.splittabledofn.OffsetRangeTracker in project beam by apache.

the class OutputAndTimeBoundedSplittableProcessElementInvokerTest method testInvokeProcessElementOutputBounded.

@Test
public void testInvokeProcessElementOutputBounded() throws Exception {
    SplittableProcessElementInvoker<Integer, String, OffsetRange, OffsetRangeTracker>.Result<Integer, String, OffsetRange, OffsetRangeTracker> res = runTest(10000, Duration.ZERO);
    OffsetRange residualRange = res.getResidualRestriction();
    // Should process the first 100 elements.
    assertEquals(1000, residualRange.getFrom());
    assertEquals(10000, residualRange.getTo());
}
Also used : OffsetRange(org.apache.beam.sdk.transforms.splittabledofn.OffsetRange) OffsetRangeTracker(org.apache.beam.sdk.transforms.splittabledofn.OffsetRangeTracker) Test(org.junit.Test)

Aggregations

OffsetRange (org.apache.beam.sdk.transforms.splittabledofn.OffsetRange)6 OffsetRangeTracker (org.apache.beam.sdk.transforms.splittabledofn.OffsetRangeTracker)6 Test (org.junit.Test)5 Instant (org.joda.time.Instant)4 PaneInfo (org.apache.beam.sdk.transforms.windowing.PaneInfo)1 Duration (org.joda.time.Duration)1