Class WordCountFunction

java.lang.Object
org.apache.pulsar.functions.api.examples.WordCountFunction
All Implemented Interfaces:
org.apache.pulsar.functions.api.Function<String,Void>

public class WordCountFunction extends Object implements org.apache.pulsar.functions.api.Function<String,Void>
The classic word count example done using pulsar functions Each input message is a sentence that split into words and each word counted. The built in counter state is used to keep track of the word count in a persistent and consistent manner.
  • Constructor Details

    • WordCountFunction

      public WordCountFunction()
  • Method Details

    • process

      public Void process(String input, org.apache.pulsar.functions.api.Context context)
      Specified by:
      process in interface org.apache.pulsar.functions.api.Function<String,Void>