【发布时间】:2018-01-19 23:07:30
【问题描述】:
最后一个reduce的速度很慢。另一个减少 我的地图和减少的数量如下 map的数量是18784,reduce的数量是1500 每次减少的平均时间约为 1'26,但最后一次减少的时间约为 2h 我尝试改变减少的数量并减少工作的大小。但没有任何改变
the last reduce 至于我的分区
public int getPartition(Object key, Object value, int numPartitions) {
// TODO Auto-generated method stub
String keyStr = key.toString();
int partId= String.valueOf(keyStr.hashCode()).hashCode();
partId = Math.abs(partId % numPartitions);
partId = Math.max(partId, 0);
return partId;
//return (key.hashCode() & Integer.MAX_VALUE) % numPartitions;
}
【问题讨论】: