Class OutputCollector<T>

java.lang.Object
org.apache.flink.runtime.operators.shipping.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 Details

    • 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 Details

    • 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>
    • getWriters

      public List<RecordWriter<SerializationDelegate<T>>> getWriters()
      List of writers that are associated with this output collector
      Returns:
      list of writers