public void accumulate(TaggedLogAPIEntity entity) throws Exception {
  AggregateAPIEntity current=root;
  for (  String groupby : groupbys) {
    String tagv=locateGroupbyField(groupby,entity);
    if (tagv == null || tagv.isEmpty()) {
      tagv=UNASSIGNED_GROUPBY_ROOT_FIELD_NAME;
    }
    Map<String,AggregateAPIEntity> children=current.getEntityList();
    if (children.get(tagv) == null) {
      children.put(tagv,factory.create());
      current.setNumDirectDescendants(current.getNumDirectDescendants() + 1);
    }
    AggregateAPIEntity child=children.get(tagv);
    if (counting)     count(child);
    for (    String sumFunctionField : sumFunctionFields) {
      sum(child,entity,sumFunctionField);
    }
    current=child;
  }
}

public void accumulate ( TaggedLogAPIEntity entity ) throws Exception { AggregateAPIEntity current = root ; for ( String groupby : groupbys ) { String tagv = locateGroupbyField ( groupby , entity ) ; if ( tagv == null || tagv . isEmpty ( ) ) { tagv = UNASSIGNED_GROUPBY_ROOT_FIELD_NAME ; } Map < String , AggregateAPIEntity > children = current . getEntityList ( ) ; if ( children . get ( tagv ) == null ) { children . put ( tagv , factory . create ( ) ) ; current . setNumDirectDescendants ( current . getNumDirectDescendants ( ) + 1 ) ; } AggregateAPIEntity child = children . get ( tagv ) ; if ( counting ) count ( child ) ; for ( String sumFunctionField : sumFunctionFields ) { sum ( child , entity , sumFunctionField ) ; } current = child ; } }
currently only group by tags groupbys ' first item always is site , which is a reserved field
