// Functions describe their output fields, which are always appended to the input fields.
// As you see, Each operations can be chained.
topology
.newStream("function", spout)
.each(new Fields("text"), new ToUpperCase(), new Fields("uppercased_text"))
.each(new Fields("text", "uppercased_text"), new Print());
// You can prune unnecessary fields using "project"
topology
.newStream("projection", spout)
.each(new Fields("text"), new ToUpperCase(), new Fields("uppercased_text"))
.project(new Fields("uppercased_text"))
.each(new Fields("uppercased_text"), new Print());
// Stream can be parallelized with "parallelismHint"
// Parallelism hint is applied downwards until a partitioning operation (we will see this later).