@Override
 public Tuple2<String, Integer> reduce(
     Tuple2<String, Integer> value1, Tuple2<String, Integer> value2) {
   value2.f0 = value1.f0 + value2.f0;
   value2.f1 = value1.f1 + value2.f1;
   return value2;
 }
 @Override
 public Tuple2<Integer, Integer> reduce(
     Tuple2<Integer, Integer> value1, Tuple2<Integer, Integer> value2) throws Exception {
   allInputs.add(value2);
   value1.f0 = value1.f0 + value2.f0;
   value1.f1 = value1.f1 + value2.f1;
   return value1;
 }
示例#3
0
    /** {@inheritDoc} */
    @Override
    public Tuple2<LongWritable, Mutation> map(PED persistentEdgeData) throws Exception {
      LongWritable key = new LongWritable(persistentEdgeData.getId());
      Put put = new Put(edgeDataHandler.getRowKey(persistentEdgeData.getId()));
      put = edgeDataHandler.writeEdgeData(put, persistentEdgeData);

      reuseTuple.f0 = key;
      reuseTuple.f1 = put;
      return reuseTuple;
    }