public void reduce(Text key, Iterable<Text> values, Context context)
            throws IOException, InterruptedException {
        String keytype = key.toString().trim();
        if (keytype.contains("ChangeRate")) {
            double max = 0.0;
            for (Text val : values) {
                double cur = Double.parseDouble(val.toString());
                if (cur > max) max = cur;
            }
            context.write(new Text("MaxChangeRate"), new Text(String.valueOf(max)));
        } else if (keytype.contains("NodeCount")) {
            int count = 0;
            for (Text val : values) {
                count += Integer.parseInt(val.toString());
            }
            context.write(new Text("NodeCount"), new Text(String.valueOf(count)));
        } else if (keytype.contains("TotalPR")) {
            double pr = 0;
            for (Text val : values) {
                pr += Double.parseDouble(val.toString());
            }
            context.write(new Text("TotalPR"), new Text(String.valueOf(pr)));
        }
    }