Class WordCount.Tokenizer

java.lang.Object
org.apache.flink.streaming.examples.wordcount.WordCount.Tokenizer
All Implemented Interfaces:
Serializable, org.apache.flink.api.common.functions.FlatMapFunction<String,org.apache.flink.api.java.tuple.Tuple2<String,Integer>>, org.apache.flink.api.common.functions.Function
Enclosing class:
WordCount

public static final class WordCount.Tokenizer extends Object implements org.apache.flink.api.common.functions.FlatMapFunction<String,org.apache.flink.api.java.tuple.Tuple2<String,Integer>>
Implements the string tokenizer that splits sentences into words as a user-defined FlatMapFunction. The function takes a line (String) and splits it into multiple pairs in the form of "(word,1)" (Tuple2<String, Integer>).
See Also:
  • Constructor Details

    • Tokenizer

      public Tokenizer()
  • Method Details

    • flatMap

      public void flatMap(String value, org.apache.flink.util.Collector<org.apache.flink.api.java.tuple.Tuple2<String,Integer>> out)
      Specified by:
      flatMap in interface org.apache.flink.api.common.functions.FlatMapFunction<String,org.apache.flink.api.java.tuple.Tuple2<String,Integer>>