[
https://issues.apache.org/jira/browse/FLINK-6198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16034929#comment-16034929
]
ASF GitHub Bot commented on FLINK-6198:
---------------------------------------
Github user alpinegizmo commented on a diff in the pull request:
https://github.com/apache/flink/pull/4041#discussion_r119886927
--- Diff: docs/dev/libs/cep.md ---
@@ -700,26 +995,29 @@ class MyPatternFlatSelectFunction<IN, OUT> implements
PatternFlatSelectFunction<
</div>
<div data-lang="scala" markdown="1">
-The `select` method takes a selection function as argument, which is
called for each matching event sequence.
-It receives a map of string/event pairs of the matched events.
-The string is defined by the name of the state to which the event has been
matched.
-The selection function returns exactly one result per call.
+The `select()` method takes a selection function as argument, which is
called for each matching event sequence.
+It receives a match in the form of `Map[String, Iterable[IN]]` where the
key is the name of each state in your pattern
+sequence and the value is an Iterable over all accepted events for that
state (`IN` is the type of your input elements).
+The events for a given state are ordered by timestamp. The reason for
returning an iterable of accepted events for each
+state is that when using looping states (e.g. `oneToMany()` and
`times()`), more than one events may be accepted for a
+given state. The selection function returns exactly one result per call.
{% highlight scala %}
-def selectFn(pattern : mutable.Map[String, IN]): OUT = {
- val startEvent = pattern.get("start").get
- val endEvent = pattern.get("end").get
+def selectFn(pattern : Map[String, Iterable[IN]]): OUT = {
+ val startEvent = pattern.get("start").get.next
+ val endEvent = pattern.get("end").get.next
OUT(startEvent, endEvent)
}
{% endhighlight %}
-The `flatSelect` method is similar to the `select` method. Their only
difference is that the function passed to the `flatSelect` method can return an
arbitrary number of results per call.
-In order to do this, the function for `flatSelect` has an additional
`Collector` parameter which is used for the element output.
+The `flatSelect` method is similar to the `select` method. Their only
difference is that the function passed to the
+`flatSelect` method can return an arbitrary number of results per call. In
order to do this, the function for
+`flatSelect` has an additional `Collector` parameter which is used for
forwarding your output elements downstream.
--- End diff --
... which is used to forward ...
> Update the documentation of the CEP library to include all the new features.
> ----------------------------------------------------------------------------
>
> Key: FLINK-6198
> URL: https://issues.apache.org/jira/browse/FLINK-6198
> Project: Flink
> Issue Type: Sub-task
> Components: CEP
> Affects Versions: 1.3.0
> Reporter: Kostas Kloudas
> Assignee: Kostas Kloudas
> Priority: Critical
> Fix For: 1.3.0
>
>
> New features to include:
> * Iterative Functions
> * Quantifiers
> * Time handling
> * Migration from FilterFunction to IterativeCondition
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)