当我做一个mapreduce程序时,我遇到键是一个元组(A,B)(A和B都是整数集)。我该如何自定义这种数据类型?
public static class MapClass extends Mapper<Object,Text,Tuple,Tuple>....
public class Tuple implements WritableComparable<Tuple>{
@Override
public void readFields(DataInput arg0) throws IOException {
// TODO Auto-generated method stub
}
@Override
public void write(DataOutput arg0) throws IOException {
// TODO Auto-generated method stub
}
@Override
public int compareTo(Tuple o) {
// TODO Auto-generated method stub
return 0;
}
}