Permalink
Browse files

Merge pull request #465 from lorcan/nathanmarz/master

Initialising ReducerAggregator if (when) state is null.
  • Loading branch information...
2 parents f94a7bf + c843ec2 commit 9ab65353e1c1621a12095c4cfec0bbcd0117f697 @nathanmarz nathanmarz committed Feb 12, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/jvm/storm/trident/state/ReducerValueUpdater.java
@@ -15,10 +15,10 @@ public ReducerValueUpdater(ReducerAggregator agg, List<TridentTuple> tuples) {
@Override
public Object update(Object stored) {
- Object ret = stored;
+ Object ret = (stored == null) ? this.agg.init() : stored;
for(TridentTuple t: tuples) {
ret = this.agg.reduce(ret, t);
}
return ret;
}
-}
+}

0 comments on commit 9ab6535

Please sign in to comment.