// it uses a custom Function "LambdaMerge" for merging the results and projects the results back to the user.
topology
.newDRPCStream("hashtags", drpc)
.each(new Fields("args"), new Split(), new Fields("hashtag"))
.groupBy(new Fields("hashtag"))
.stateQuery(hashTagCounts, new Fields("hashtag"), new MapGet(), new Fields("resultrt"))
.stateQuery(sploutState, new Fields("hashtag", "resultrt"), new HashTagsSploutQuery(),
new Fields("resultbatch"))
.each(new Fields("hashtag", "resultrt", "resultbatch"), new LambdaMerge(), new Fields("result"))
// Project allows us to keep only the interesting results
.project(new Fields("result"));