title: Storm Trident 'average aggregator
body: <p>I am a newbie to Trident and I'm looking to create an 'Average' aggregator similar to 'Sum(), but for 'Average'.The following does not work:</p>
  
  <pre><code>       public class Average implements CombinerAggregator&lt;Long&gt;.......{
  
         public Long init(TridentTuple tuple)
         {
         (Long)tuple.getValue(0);
          }
          public Long Combine(long val1,long val2){
          return val1+val2/2;
          }
          public Long zero(){
          return 0L;
           }
         }
  </code></pre>
  
  <p>It may not be exactly syntactically correct, but that's the idea. Please help if you can. Given 2 tuples with values [2,4,1] and [2,2,5] and fields 'a','b' and 'c' and doing an average on field 'b' should return '3'. I'm not entirely sure how init() and zero() work.</p>
  
  <p>Thank you so much for your help in advance.</p>
  
  <p>Eli</p>