image.png

    1. /*
    2. * Licensed to the Apache Software Foundation (ASF) under one
    3. * or more contributor license agreements. See the NOTICE file
    4. * distributed with this work for additional information
    5. * regarding copyright ownership. The ASF licenses this file
    6. * to you under the Apache License, Version 2.0 (the
    7. * "License"); you may not use this file except in compliance
    8. * with the License. You may obtain a copy of the License at
    9. *
    10. * http://www.apache.org/licenses/LICENSE-2.0
    11. *
    12. * Unless required by applicable law or agreed to in writing, software
    13. * distributed under the License is distributed on an "AS IS" BASIS,
    14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15. * See the License for the specific language governing permissions and
    16. * limitations under the License.
    17. */
    18. package org.apache.flink.streaming.api.operators;
    19. import org.apache.flink.annotation.PublicEvolving;
    20. import org.apache.flink.streaming.api.watermark.Watermark;
    21. import org.apache.flink.streaming.runtime.streamrecord.LatencyMarker;
    22. import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
    23. import org.apache.flink.util.Collector;
    24. import org.apache.flink.util.OutputTag;
    25. /**
    26. * A {@link org.apache.flink.streaming.api.operators.StreamOperator} is supplied with an object
    27. * of this interface that can be used to emit elements and other messages, such as barriers
    28. * and watermarks, from an operator.
    29. *
    30. * @param <T> The type of the elements that can be emitted.
    31. */
    32. @PublicEvolving
    33. public interface Output<T> extends Collector<T> {
    34. /**
    35. * Emits a {@link Watermark} from an operator. This watermark is broadcast to all downstream
    36. * operators.
    37. *
    38. * <p>A watermark specifies that no element with a timestamp lower or equal to the watermark
    39. * timestamp will be emitted in the future.
    40. */
    41. void emitWatermark(Watermark mark);
    42. /**
    43. * Emits a record the side output identified by the given {@link OutputTag}.
    44. *
    45. * @param record The record to collect.
    46. */
    47. <X> void collect(OutputTag<X> outputTag, StreamRecord<X> record);
    48. void emitLatencyMarker(LatencyMarker latencyMarker);
    49. }