Hi,
I have a sliding window that computes a mean value of a consumption value, what
I want is to compare this mean value to each incoming tuple's own consumption
value.
I would like to do this from the stream of one spout.
Could this be done by collecting the mean value in a MemoryMapState.Factory()
as in the WordCount example?
TridentState meanValue = .groupBy(new Fields("mean")).persistentAggregate(new
MemoryMapState.Factory(),
new UpdateMean(), new Fields("mean"))
And then let each new tuple in the stream compare it's value with the state
through a stateQuery
.stateQuery(meanValue, new Fields("mean"), new MapGet(), new Fields("mean")).
Is this a possible path to a solution?
I have tried join and merge but with no luck, as the streams doesn't contain
the same fields and isn't synchronized.
Thanks in advance?
Jonas Sandström