Class HadoopOutputCollector<KEY,​VALUE>

  • All Implemented Interfaces:
    org.apache.hadoop.mapred.OutputCollector<KEY,​VALUE>

    public final class HadoopOutputCollector<KEY,​VALUE>
    extends Object
    implements org.apache.hadoop.mapred.OutputCollector<KEY,​VALUE>
    A Hadoop OutputCollector that wraps a Flink OutputCollector. On each call of collect() the data is forwarded to the wrapped Flink collector.
    • Constructor Detail

      • HadoopOutputCollector

        public HadoopOutputCollector()
    • Method Detail

      • setFlinkCollector

        public void setFlinkCollector​(Collector<Tuple2<KEY,​VALUE>> flinkCollector)
        Set the wrapped Flink collector.
        Parameters:
        flinkCollector - The wrapped Flink OutputCollector.
      • collect

        public void collect​(KEY key,
                            VALUE val)
                     throws IOException
        Use the wrapped Flink collector to collect a key-value pair for Flink.
        Specified by:
        collect in interface org.apache.hadoop.mapred.OutputCollector<KEY,​VALUE>
        Parameters:
        key - the key to collect
        val - the value to collect
        Throws:
        IOException - unexpected of key or value in key-value pair.