Introducing Trident operations – filters and functions

Now that we have events being generated, the next step is to add the logic components that implement the business process. In Trident, these are known as operations. In our topology, we are using two different types of operations: filters and functions.

Operations are applied to streams via methods on the Stream object. In this example, we use the following methods on the Stream object:

public class Stream implements IAggregatableStream { public Stream each(Fields inputFields, Filter filter) { ... } public IAggregatableStream each(Fields inputFields, Function function, Fields functionFields){ ... } public GroupedStream groupBy(Fields fields) { ... } public TridentState persistentAggregate( StateFactory ...

Get Storm Blueprints: Patterns for Distributed Real-time Computation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.