Skip to content

Instantly share code, notes, and snippets.

@isaacmg
Last active December 1, 2017 19:05
Show Gist options
  • Save isaacmg/4bede897ca9822cf353566af02eaa410 to your computer and use it in GitHub Desktop.
Save isaacmg/4bede897ca9822cf353566af02eaa410 to your computer and use it in GitHub Desktop.
Pattern<Tuple2<String, Integer>, ?> pattern =
Pattern.<Tuple2<String,Integer>>begin("first")
.where(new SimpleCondition2(15)).followedBy("increasing")
.where(new SimpleCondition2(20))
PatternStream<Tuple2<String, Integer>> patternStream =
CEP.pattern(dataWindowKafka.keyBy(0), pattern);
DataStream<String> manyMentions = patternStream
.select(new PatternSelectFunction<Tuple2<String, Integer>, String>() {
@Override
public String select(Map<String, List<Tuple2<String, Integer>>> map) throws Exception {
System.out.println(map.toString());
return "the word " + map.toString() ;
}
});
DataStream<String> manyMentions =
patternStream.select(new PatternSelectFunction<Tuple2<String, Integer>, String>() {
@Override
public String select(Map<String, List<Tuple2<String, Integer>>> map) throws Exception {
System.out.println(map.toString());
return "the word " + map.toString() ;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment