Class TestStream<T>
- All Implemented Interfaces:
Serializable
,HasDisplayData
PCollection
of elements, advancing the
watermark and processing time as elements are emitted. After all of the specified elements are
emitted, ceases to produce output.
Each call to a TestStream.Builder
method will only be reflected in the state of the
Pipeline
after each method before it has completed and no more progress can be made by
the Pipeline
. A PipelineRunner
must ensure that no more progress can be made in
the Pipeline
before advancing the state of the TestStream
.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
An incompleteTestStream
.static class
ATestStream.Event
that produces elements.static interface
An event in aTestStream
.static enum
The types ofTestStream.Event
that are supported byTestStream
.static class
ATestStream.Event
that advances the processing time clock.static class
Coder forTestStream
.static class
ATestStream.Event
that advances the watermark. -
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TestStream.Builder
<T> Create a newTestStream.Builder
with no elements and watermark equal toBoundedWindow.TIMESTAMP_MIN_VALUE
.static TestStream.Builder
<Row> static <T> TestStream.Builder
<T> create
(Schema schema, TypeDescriptor<T> typeDescriptor, SerializableFunction<T, Row> toRowFunction, SerializableFunction<Row, T> fromRowFunction) boolean
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.static <T> TestStream
<T> fromRawEvents
(Coder<T> coder, List<TestStream.Event<T>> events) For internal use only.Returns the sequence ofEvents
in thisTestStream
.int
hashCode()
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Method Details
-
create
Create a newTestStream.Builder
with no elements and watermark equal toBoundedWindow.TIMESTAMP_MIN_VALUE
. -
create
-
create
public static <T> TestStream.Builder<T> create(Schema schema, TypeDescriptor<T> typeDescriptor, SerializableFunction<T, Row> toRowFunction, SerializableFunction<Row, T> fromRowFunction) -
expand
Description copied from class:PTransform
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
method.Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
- Specified by:
expand
in classPTransform<PBegin,
PCollection<T>>
-
getValueCoder
-
getEvents
-
fromRawEvents
@Internal public static <T> TestStream<T> fromRawEvents(Coder<T> coder, List<TestStream.Event<T>> events) For internal use only. No backwards-compatibility guarantees.Builder a test stream directly from events. No validation is performed on watermark monotonicity, etc. This is assumed to be a previously-serialized
TestStream
transform that is correct by construction. -
equals
-
hashCode
public int hashCode()
-