package es.tid.cosmos.mobility.clientlabelling;

import java.io.IOException;

import com.twitter.elephantbird.mapreduce.io.ProtobufWritable;
import org.apache.hadoop.mapreduce.Reducer;

import es.tid.cosmos.mobility.data.MobProtocol.DailyVector;
import es.tid.cosmos.mobility.data.MobProtocol.NodeBts;
import es.tid.cosmos.mobility.data.MobProtocol.TwoInt;
import es.tid.cosmos.mobility.data.TwoIntUtil;

/**
 *
 * @author dmicol
 */
public class VectorCreateNodeDayhourReducer extends Reducer
        <ProtobufWritable<NodeBts>, ProtobufWritable<TwoInt>,
        ProtobufWritable<TwoInt>, ProtobufWritable<DailyVector>> {
    @Override
    protected void setup(Context context) throws IOException,
                                                 InterruptedException {
    }

    @Override
    protected void reduce(ProtobufWritable<NodeBts> key,
                          Iterable<ProtobufWritable<TwoInt>> values,
                          Context context) throws IOException,
                                                  InterruptedException {
        final NodeBts bts = key.get();
        DailyVector.Builder vectorBuilder = DailyVector.newBuilder();
        long num2 = 0;
        for (int i = 0; i < 24; i++) {
            boolean added = false;
            for (ProtobufWritable<TwoInt> value : values) {
                num2 = value.get().getNum2();
                if (value.get().getNum1() == i) {
                    added = true;
                    break;
                }
            }
            if (!added) {
                num2 = 0;
            }
            TwoInt hourComms = TwoIntUtil.create(key.get().getWeekday(), num2);
            vectorBuilder.addHours(hourComms);
        }
        DailyVector vector = vectorBuilder.build();
        ProtobufWritable<DailyVector> vectorWrapper =
                ProtobufWritable.newInstance(DailyVector.class);
        vectorWrapper.set(vector);
        ProtobufWritable<TwoInt> node = TwoIntUtil.createAndWrap(
                bts.getUserId(), bts.getPlaceId());
        context.write(node, vectorWrapper);
    }
}

@@ -620,163 +620,8 @@
 %3E %7B%0A
-    @Override%0A    protected void setup(Context context) throws IOException,%0A                                                 InterruptedException %7B%0A    %7D%0A%0A
     

Remove unused method.