vvcephei commented on a change in pull request #10994: URL: https://github.com/apache/kafka/pull/10994#discussion_r668857339
########## File path: docs/streams/developer-guide/processor-api.html ########## @@ -119,45 +157,42 @@ <h2><a class="toc-backref" href="#id1">Overview</a><a class="headerlink" href="# <li>In the <code class="docutils literal"><span class="pre">process()</span></code> method, upon each received record, split the value string into words, and update their counts into the state store (we will talk about this later in this section).</li> <li>In the <code class="docutils literal"><span class="pre">punctuate()</span></code> method, iterate the local state store and send the aggregated counts to the downstream processor (we will talk about downstream processors later in this section), and commit the current stream state.</li> </ul> - <pre class="line-numbers"><code class="language-java">public class WordCountProcessor implements Processor<String, String> { - - private ProcessorContext context; - private KeyValueStore<String, Long> kvStore; - - @Override - @SuppressWarnings("unchecked") - public void init(ProcessorContext context) { - // keep the processor context locally because we need it in punctuate() and commit() - this.context = context; + <pre class="line-numbers"><code class="language-java">public class WordCountProcessor implements Processor<String, String, String, String> { + private KeyValueStore<String, Integer> kvStore; - // retrieve the key-value store named "Counts" - kvStore = (KeyValueStore) context.getStateStore("Counts"); + @Override + public void init(final ProcessorContext<String, String> context) { + context.schedule(Duration.ofSeconds(1), PunctuationType.STREAM_TIME, timestamp -> { Review comment: ```suggestion context.schedule(Duration.ofSeconds(1), PunctuationType.STREAM_TIME, timestamp -> { ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org