// from Operator
  @Override
  public List<String> process(List<String> tuple) {
    _numTuplesProcessed++;
    if (_distinct != null) {
      tuple = _distinct.process(tuple);
      if (tuple == null) {
        return null;
      }
    }
    String tupleHash;
    if (_groupByType == GB_PROJECTION) {
      tupleHash =
          MyUtilities.createHashString(
              tuple, _groupByColumns, _groupByProjection.getExpressions(), _map);
    } else {
      tupleHash = MyUtilities.createHashString(tuple, _groupByColumns, _map);
    }
    T value = _storage.update(tuple, tupleHash);
    String strValue = _wrapper.toString(value);

    // propagate further the affected tupleHash-tupleValue pair
    List<String> affectedTuple = new ArrayList<String>();
    affectedTuple.add(tupleHash);
    affectedTuple.add(strValue);

    return affectedTuple;
  }
示例#2
0
 public Addition(ValueExpression ve1, ValueExpression ve2, ValueExpression... veArray) {
   _veList.add(ve1);
   _veList.add(ve2);
   _veList.addAll(Arrays.asList(veArray));
   _wrapper = (NumericConversion<T>) MyUtilities.getDominantNumericType(_veList);
 }