dianfu commented on a change in pull request #15702:
URL: https://github.com/apache/flink/pull/15702#discussion_r617507819



##########
File path: docs/content.zh/docs/dev/python/datastream/operators/windows.md
##########
@@ -0,0 +1,587 @@
+---
+title: "Windows"
+weight: 2
+type: docs
+aliases:
+  - /zh/dev/python/datastream/operators/windows.html
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Windows
+
+Windows are at the heart of processing infinite streams. Windows split the 
stream into "buckets" of finite size,
+over which we can apply computations. This document focuses on how windowing 
is performed in Flink and how the
+programmer can benefit to the maximum from its offered functionality.
+
+Currently, the widow operation is only supported in *keyed* streams
+
+**Keyed Windows**
+
+    stream
+           .key_by(...)
+           .window(...)              <-  required: "assigner"
+          [.trigger(...)]            <-  optional: "trigger" (else default 
trigger)
+          [.allowed_lateness(...)]   <-  optional: "lateness" (else zero)
+           .apply/process()          <-  required: "function"
+
+In the above, the commands in square brackets ([...]) are optional. This 
reveals that Flink allows you to customize your
+windowing logic in many different ways so that it best fits your needs.
+
+## Window Lifecycle
+
+In a nutshell, a window is **created** as soon as the first element that 
should belong to this window arrives, and the
+window is **completely removed** when the time (event or processing time) 
passes its end timestamp plus the user-specified
+`allowed lateness` (see [Allowed Lateness](#allowed-lateness)). Flink 
guarantees removal only for time-based
+windows and not for other types, *e.g.* global windows (see [Window 
Assigners](#window-assigners)). For example, with an
+event-time-based windowing strategy that creates non-overlapping (or tumbling) 
windows every 5 minutes and has an allowed
+lateness of 1 min, Flink will create a new window for the interval between 
`12:00` and `12:05` when the first element with
+a timestamp that falls into this interval arrives, and it will remove it when 
the watermark passes the `12:06`
+timestamp.
+
+In addition, each window will have a `Trigger` (see [Triggers](#triggers)) and 
a function (`WindowFunction` or `ProcessWindowFunction`)
+(see [Window Functions](#window-functions)) attached to it. The function will 
contain the computation to
+be applied to the contents of the window, while the `Trigger` specifies the 
conditions under which the window is
+considered ready for the function to be applied. A triggering policy might be 
something like "when the number of elements
+in the window is more than 4", or "when the watermark passes the end of the 
window". A trigger can also decide to
+purge a window's contents any time between its creation and removal. Purging 
in this case only refers to the elements
+in the window, and *not* the window metadata. This means that new data can 
still be added to that window.
+
+In the following we go into more detail for each of the components above. We 
start with the required parts in the above
+snippet (see [Keyed Windows](#keyed-windows), [Window 
Assigner](#window-assigners), and[Window Function](#window-functions)) 

Review comment:
       ```suggestion
   snippet (see [Keyed Windows](#keyed-windows), [Window 
Assigner](#window-assigners), and [Window Function](#window-functions)) 
   ```

##########
File path: docs/content.zh/docs/dev/python/datastream/operators/overview.md
##########
@@ -1,9 +1,9 @@
 ---
-title: "Operators"
-weight: 21
+title: "Overview"
+weight: 1
 type: docs
 aliases:
-  - /dev/python/datastream-api-users-guide/operators.html

Review comment:
       this is the alias for previous releases, such as 1.12 and so I think we 
should not change it.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to