public static class TestStream.Builder<T>
extends java.lang.Object
TestStream
. Elements added to this builder will be produced in sequence
when the pipeline created by the TestStream
is run.Modifier and Type | Method and Description |
---|---|
TestStream.Builder<T> |
addElements(TimestampedValue<T> element,
TimestampedValue<T>... elements)
Adds the specified elements to the source with the provided timestamps.
|
TestStream.Builder<T> |
addElements(T element,
T... elements)
Adds the specified elements to the source with timestamp equal to the current watermark.
|
TestStream.Builder<T> |
advanceProcessingTime(Duration amount)
Advance the processing time by the specified amount.
|
TestStream.Builder<T> |
advanceWatermarkTo(Instant newWatermark)
Advance the watermark of this source to the specified instant.
|
TestStream<T> |
advanceWatermarkToInfinity()
Advance the watermark to infinity, completing this
TestStream . |
@SafeVarargs public final TestStream.Builder<T> addElements(T element, T... elements)
TestStream.Builder
like this one that will add the provided elements after
all earlier events have completed.@SafeVarargs public final TestStream.Builder<T> addElements(TimestampedValue<T> element, TimestampedValue<T>... elements)
TestStream.Builder
like this one that will add the provided elements after
all earlier events have completed.public TestStream.Builder<T> advanceWatermarkTo(Instant newWatermark)
The watermark must advance monotonically and cannot advance to BoundedWindow.TIMESTAMP_MAX_VALUE
or beyond.
TestStream.Builder
like this one that will advance the watermark to the
specified point after all earlier events have completed.public TestStream.Builder<T> advanceProcessingTime(Duration amount)
TestStream.Builder
like this one that will advance the processing time by
the specified amount after all earlier events have completed.public TestStream<T> advanceWatermarkToInfinity()
TestStream
. Future calls to the
same builder will not affect the returned TestStream
.