public void map(Object key, Text value, Context context)
    throws IOException, InterruptedException{
        String line = value.toString();
        String[] fields = line.split(" ");
        double minDist = Double.MAX_VALUE;
        int centerIndex = k;
        //计算样本点到各个中心的距离，并把样本聚类到距离最近的中心点所属的类
        for (int i = 0; i < k; ++i){
            double currentDist = 0;
            for (int j = 1; j < fields.length; ++j){
                double tmp = Math.abs(centers.get(i).get(j) - Double.parseDouble(fields[j]));
                currentDist += Math.pow(tmp, 2);
            }
            if (minDist > currentDist){
                minDist = currentDist;
                centerIndex = i;
            }
        }
        context.write(new IntWritable(centerIndex), new Text(value));
    }