Class OutputCollector<T>

  • All Implemented Interfaces:
    org.apache.flink.util.Collector<T>

    public class OutputCollector<T>
    extends Object
    implements org.apache.flink.util.Collector<T>
    The OutputCollector collects records, and emits them to the RecordWriters. The OutputCollector tracks to which writers a deep-copy must be given and which not.
    • Constructor Detail

      • OutputCollector

        public OutputCollector​(List<RecordWriter<SerializationDelegate<T>>> writers,
                               org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
        Initializes the output collector with a set of writers. To specify for a writer that it must be fed with a deep-copy, set the bit in the copy flag bit mask to 1 that corresponds to the position of the writer within the List.
        Parameters:
        writers - List of all writers.
    • Method Detail

      • collect

        public void collect​(T record)
        Collects a record and emits it to all writers.
        Specified by:
        collect in interface org.apache.flink.util.Collector<T>
      • close

        public void close()
        Specified by:
        close in interface org.apache.flink.util.Collector<T>