Class WordCountWindowFunction
- java.lang.Object
-
- org.apache.pulsar.functions.api.examples.window.WordCountWindowFunction
-
- All Implemented Interfaces:
org.apache.pulsar.functions.api.WindowFunction<java.lang.String,java.lang.Void>
public class WordCountWindowFunction extends java.lang.Object implements org.apache.pulsar.functions.api.WindowFunction<java.lang.String,java.lang.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 Summary
Constructors Constructor Description WordCountWindowFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Voidprocess(java.util.Collection<org.apache.pulsar.functions.api.Record<java.lang.String>> inputs, org.apache.pulsar.functions.api.WindowContext context)
-
-
-
Method Detail
-
process
public java.lang.Void process(java.util.Collection<org.apache.pulsar.functions.api.Record<java.lang.String>> inputs, org.apache.pulsar.functions.api.WindowContext context) throws java.lang.Exception- Specified by:
processin interfaceorg.apache.pulsar.functions.api.WindowFunction<java.lang.String,java.lang.Void>- Throws:
java.lang.Exception
-
-