This is an automated email from the ASF dual-hosted git repository.

saniljain15 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/samza.git


The following commit(s) were added to refs/heads/master by this push:
     new 29deb42  Fix in the documentation for Window Types in high level api 
documentation (#1482)
29deb42 is described below

commit 29deb426b3adf1d73e6c5e74330280efbebc974e
Author: ajo thomas <[email protected]>
AuthorDate: Thu Mar 25 17:45:21 2021 -0700

    Fix in the documentation for Window Types in high level api documentation 
(#1482)
    
    Co-authored-by: Ajo Thomas <[email protected]>
---
 .../documentation/versioned/api/high-level-api.md     | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/docs/learn/documentation/versioned/api/high-level-api.md 
b/docs/learn/documentation/versioned/api/high-level-api.md
index bdb75d3..9176180 100644
--- a/docs/learn/documentation/versioned/api/high-level-api.md
+++ b/docs/learn/documentation/versioned/api/high-level-api.md
@@ -370,7 +370,7 @@ Examples:
     
     // Group the pageView stream into 30 second tumbling windows keyed by the 
userId.
     MessageStream<PageView> pageViews = ...
-    MessageStream<WindowPane<String, Collection<PageView>>> = pageViews.window(
+    MessageStream<WindowPane<String, Collection<PageView>>> windowedStream = 
pageViews.window(
         Windows.keyedTumblingWindow(
             pageView -> pageView.getUserId(), // key extractor
             Duration.ofSeconds(30), // window duration
@@ -397,6 +397,11 @@ Examples:
 
 {% highlight java %}
 
+    // Sessionize a stream of page views with a session gap of 10 seconds
+    MessageStream<PageView> pageViews = …
+    MessageStream<WindowPane<String>, Collection<PageView>> windowedStream = 
pageViews.window(
+      Windows.keyedSessionWindow(pageView -> pageView.getUserId(), 
Duration.ofSeconds(10)));
+    
     // Sessionize a stream of page views, and count the number of page-views 
in a session for every user.
     MessageStream<PageView> pageViews = …
     Supplier<Integer> initialValue = () -> 0
@@ -410,18 +415,6 @@ Examples:
             initialValue, 
             countAggregator,
             new StringSerde(), new IntegerSerde()));
-
-    // Compute the maximum value over tumbling windows of 30 seconds.
-    MessageStream<Integer> integers = …
-    Supplier<Integer> initialValue = () -> Integer.MAX_INT
-    FoldLeftFunction<Integer, Integer> aggregateFunction = (msg, oldValue) -> 
Math.max(msg, oldValue)
-    
-    MessageStream<WindowPane<Void, Integer>> windowedStream = integers.window(
-        Windows.tumblingWindow(
-            Duration.ofSeconds(30), 
-            initialValue, 
-            aggregateFunction,
-            new IntegerSerde()));
          
 {% endhighlight %}
 

Reply via email to