O'Reilly logo

Storm Blueprints: Patterns for Distributed Real-time Computation by Brian O'Neill, P. Taylor Goetz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required