Class TestStream<T>

  • All Implemented Interfaces:
    java.io.Serializable, HasDisplayData

    public final class TestStream<T>
    extends PTransform<PBegin,​PCollection<T>>
    A testing input that generates an unbounded 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:
    Serialized Form
    • Method Detail

      • expand

        public PCollection<T> expand​(PBegin input)
        Description copied from class: PTransform
        Override this method to specify how this PTransform should be expanded on the given InputT.

        NOTE: This method should not be called directly. Instead apply the PTransform should be applied to the InputT using the apply 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 class PTransform<PBegin,​PCollection<T>>
      • getValueCoder

        public Coder<T> getValueCoder()
      • fromRawEvents

        @Internal
        public static <T> TestStream<T> fromRawEvents​(Coder<T> coder,
                                                      java.util.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

        public boolean equals​(@Nullable java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object