calrissian / flowmix

Flowmix is a flexible event processing engine for Apache Storm. It supports complex correlations of events via sliding/tumbling windows. It allows parallel streams to be processed that can be grouped together in different ways.
Apache License 2.0
55 stars 20 forks source link

FilterOp should take a Filter class and not just assume a QueryBuilder #20

Closed cjnolet closed 10 years ago

cjnolet commented 10 years ago

Suppose we have a filter that looks like this:

public interface Filter() {
    boolean accept(Event event);
}

And suppose we have a CriteriaFilter:

public class CriteriaFilter implements Filter {

   private Criteria criteria;

   public CriteriaFilter(Node node) {
      this.criteria= nodeToCriteria(node);
   }

   public boolean accept(Event event) {
      return criteria.matches(event);
   }
}