test_class.file: tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/statistics/TestStatisticsUtil.java
test_class.identifier: TestStatisticsUtil
test_case.body: @Test
    public void testAggregate() throws CloneNotSupportedException {
      Stat stat = new Stat(StatType.TABLE_NUM_ROWS);
      stat.incrementBy(100); // 100
      assertEquals(100, stat.getValue());
      
      Stat stat2 = (Stat) stat.clone();
      stat2.incrementBy(100); // 200
      assertEquals(200, stat2.getValue());
      
      Stat stat3 = new Stat(StatType.TABLE_NUM_BLOCKS);
      stat3.incrementBy(50); // 50
      assertEquals(50, stat3.getValue());
      
      StatSet group = new StatSet();
      group.putStat(stat); // num of rows - 100 
      group.putStat(stat2); // num of rows - 200
      group.putStat(stat3); // num of blocks - 50
      
      // One group has 300 rows and 50 blocks, and it is cloned.
      StatSet group2 = (StatSet) group.clone();
      group2.getStat(StatType.TABLE_NUM_ROWS).incrementBy(100); // plus 100
      
      // expected that num of rows = 200 * 2 + 100, num of blocks = 50 * 2 
      StatSet agg = StatisticsUtil.aggregateStatSet(
          Lists.newArrayList(group, group2));
      assertEquals(500, agg.getStat(StatType.TABLE_NUM_ROWS).getValue());
      assertEquals(100, agg.getStat(StatType.TABLE_NUM_BLOCKS).getValue());
    }
test_case.class_method_signature: TestStatisticsUtil.testAggregate()
test_case.full_signature: @Test public void testAggregate()
test_case.identifier: testAggregate
test_case.invocations: incrementBy assertEquals getValue clone incrementBy assertEquals getValue incrementBy assertEquals getValue putStat putStat putStat clone incrementBy getStat aggregateStatSet newArrayList assertEquals getValue getStat assertEquals getValue getStat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAggregate()
focal_class.declarator: LOG = LogFactory.getLog(StatisticsUtil.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Log LOG = LogFactory.getLog(StatisticsUtil.class);
focal_class.type: Log
focal_class.var_name: LOG
focal_class.file: tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/statistics/StatisticsUtil.java
focal_class.identifier: StatisticsUtil
focal_class.class_method_signature: StatisticsUtil.aggregateStatSet(List<StatSet> statSets)
focal_class.full_signature: public static StatSet aggregateStatSet(List<StatSet> statSets)
focal_class.identifier: aggregateStatSet
focal_class.modifiers: public static
focal_class.parameters: (List<StatSet> statSets)
focal_class.return: StatSet
focal_class.signature: StatSet aggregateStatSet(List<StatSet> statSets)
focal_class.class_method_signature: StatisticsUtil.aggregateTableStat(TableStats result, TableStats stats)
focal_class.full_signature: public static void aggregateTableStat(TableStats result, TableStats stats)
focal_class.identifier: aggregateTableStat
focal_class.modifiers: public static
focal_class.parameters: (TableStats result, TableStats stats)
focal_class.return: void
focal_class.signature: void aggregateTableStat(TableStats result, TableStats stats)
focal_class.class_method_signature: StatisticsUtil.aggregateTableStat(List<TableStats> tableStatses)
focal_class.full_signature: public static TableStats aggregateTableStat(List<TableStats> tableStatses)
focal_class.identifier: aggregateTableStat
focal_class.modifiers: public static
focal_class.parameters: (List<TableStats> tableStatses)
focal_class.return: TableStats
focal_class.signature: TableStats aggregateTableStat(List<TableStats> tableStatses)
focal_method.body: public static StatSet aggregateStatSet(List<StatSet> statSets) {
      StatSet aggregated = new StatSet();
  
      for (StatSet statSet : statSets) {
        for (Stat stat : statSet.getAllStats()) {
          if (aggregated.containStat(stat.getType())) {
            aggregated.getStat(stat.getType()).incrementBy(stat.getValue());
          } else {
            aggregated.putStat(stat);
          }
        }
      }
      return aggregated;
    }
focal_method.class_method_signature: StatisticsUtil.aggregateStatSet(List<StatSet> statSets)
focal_method.full_signature: public static StatSet aggregateStatSet(List<StatSet> statSets)
focal_method.identifier: aggregateStatSet
focal_method.invocations: getAllStats containStat getType incrementBy getStat getType getValue putStat
focal_method.modifiers: public static
focal_method.parameters: (List<StatSet> statSets)
focal_method.return: StatSet
focal_method.signature: StatSet aggregateStatSet(List<StatSet> statSets)