package es.tid.ps.mobility.jobs;

import com.twitter.elephantbird.mapreduce.io.ProtobufWritable;
import java.io.IOException;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.mapreduce.Mapper;

import es.tid.ps.mobility.data.MxProtocol.MxCdr;

/**
 *
 * @author dmicol
 */
public class MobmxFilterCellnoinfoMapper extends Mapper<IntWritable,
        ProtobufWritable<MxCdr>, IntWritable, ProtobufWritable<MxCdr>> {
    @Override
    public void map(IntWritable key, ProtobufWritable<MxCdr> value,
            Context context) throws IOException, InterruptedException {
        MxCdr cdr = value.get();
        if (cdr.getCell() != 0) {
            context.write(new IntWritable(cdr.getCell()), value);
        } else {
            context.write(key, value);
        }
    }
}

@@ -424,16 +424,322 @@
 Cdr%3E%3E %7B%0A
+    public enum OutputKey %7B%0A        INVALID,%0A        CELL,%0A        NODE%0A    %7D%0A    %0A    private OutputKey outputKey;%0A    %0A    public MobmxFilterCellnoinfoMapper() %7B%0A        this.outputKey = OutputKey.INVALID;%0A    %7D%0A    %0A    public void setOutputKey(OutputKey key) %7B%0A        this.outputKey = key;%0A    %7D%0A    %0A
     @Ove
@@ -1050,34 +1050,382 @@
     
-context.write(key, value);
+switch (this.outputKey) %7B%0A                case CELL:%0A                    context.write(new IntWritable(cdr.getCell()), value);%0A                    break;%0A                case NODE:%0A                    context.write(key, value);%0A                    break;%0A                default:%0A                    throw new RuntimeException(%22Output key type is not valid.%22);%0A            %7D
 %0A   

Add multiple outputs to MobmxFilterCellnoinfoMapper.