Last active
December 1, 2017 19:05
-
-
Save isaacmg/4bede897ca9822cf353566af02eaa410 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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