Skip to content

Instantly share code, notes, and snippets.

@isaacmg
Created December 1, 2017 19:26
Show Gist options
  • Save isaacmg/23674c1d77b7c0248ed95592c9f5b270 to your computer and use it in GitHub Desktop.
Save isaacmg/23674c1d77b7c0248ed95592c9f5b270 to your computer and use it in GitHub Desktop.
final.java
.followedBy("End").where(new IterativeCondition<Tuple2<String, Integer>>() {
@Override
public boolean filter(Tuple2<String, Integer> stringIntegerTuple2, Context<Tuple2<String, Integer>> context) throws Exception {
List<Tuple2<String,Integer>> s = Lists.newArrayList(context.getEventsForPattern("End"));
int i = s.size();
int value = stringIntegerTuple2.getField(1);
int prevValue = s.get(i-1).getField(1);
return value>prevValue;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment