Exemplo n.º 1
0
 @Override
 public MsgList<DoubleWritable> finishFinal() {
   agg.set(sum);
   msgList.clear();
   msgList.add(agg);
   return msgList;
 }
  public AggregationEvaluator(
      IHyracksTaskContext ctx,
      IConfigurationFactory confFactory,
      boolean isFinalStage,
      boolean partialAggAsInput)
      throws HyracksDataException {
    this.conf = confFactory.createConfiguration(ctx);
    this.isFinalStage = isFinalStage;
    this.partialAggAsInput = partialAggAsInput;
    msgList.setConf(this.conf);

    combiner = BspUtils.createMessageCombiner(conf);
    key = BspUtils.createVertexIndex(conf);
    value =
        !partialAggAsInput
            ? BspUtils.createMessageValue(conf)
            : BspUtils.createPartialCombineValue(conf);
    skipKey = BspUtils.getSkipCombinerKey(conf);
  }