Class LoggingWindowFunction

java.lang.Object
org.apache.pulsar.functions.api.examples.window.LoggingWindowFunction
All Implemented Interfaces:
org.apache.pulsar.functions.api.WindowFunction<String,Void>

public class LoggingWindowFunction extends Object implements org.apache.pulsar.functions.api.WindowFunction<String,Void>
A function that demonstrates how to redirect logging to a topic. In this particular example, for every input string, the function does some logging. If --logTopic topic is specified, these log statements end up in that specified pulsar topic.
  • Constructor Details

    • LoggingWindowFunction

      public LoggingWindowFunction()
  • Method Details

    • process

      public Void process(Collection<org.apache.pulsar.functions.api.Record<String>> inputs, org.apache.pulsar.functions.api.WindowContext context) throws Exception
      Specified by:
      process in interface org.apache.pulsar.functions.api.WindowFunction<String,Void>
      Throws:
      Exception