Skip to content

Commit

Permalink
[FLINK-4165] Add warning about equals/hashCode to CEP doc
Browse files Browse the repository at this point in the history
  • Loading branch information
aljoscha committed Jul 18, 2016
1 parent 3d8d192 commit 7329074
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/apis/streaming/libs/cep.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ It allows you to easily detect complex event patterns in a stream of endless dat
Complex events can then be constructed from matching sequences.
This gives you the opportunity to quickly get hold of what's really important in your data.

<span class="label label-danger">Attention</span> The events in the `DataStream` to which
you want to apply pattern matching have to implement proper `equals()` and `hashCode()` methods
because these are used for comparing and matching events.

* This will be replaced by the TOC
{:toc}

## Getting Started

If you want to jump right in, you have to [set up a Flink program]({{ site.baseurl }}/apis/batch/index.html#linking-with-flink).
Expand Down Expand Up @@ -518,10 +525,10 @@ The collector can be used to emit an arbitrary number of events.
val patternStream: PatternStream[Event] = CEP.pattern(input, pattern)

DataStream[Either[TimeoutEvent, ComplexEvent]] result = patternStream.flatSelect{
(pattern: mutable.Map[String, Event], timestamp: Long, out: Collector[TimeoutEvent]) =>
(pattern: mutable.Map[String, Event], timestamp: Long, out: Collector[TimeoutEvent]) =>
out.collect(TimeoutEvent())
} {
(pattern: mutable.Map[String, Event], out: Collector[ComplexEvent]) =>
(pattern: mutable.Map[String, Event], out: Collector[ComplexEvent]) =>
out.collect(ComplexEvent())
}
{% endhighlight %}
Expand Down

0 comments on commit 7329074

Please sign in to comment.