public int run(String[] args) throws Exception {
        if (args.length != 2) {
            System.out.println("Usage: <input_file> <output>");
            return 2;
        }

        Job job = new Job(getConf(), "SimplePageRank");
        job.setJarByClass(PageRankTool.class);

        job.setMapperClass(PageRankMapper.class);
        job.setCombinerClass(DoubleSumCombiner.class);
        job.setReducerClass(DoubleSumReducer.class);

        job.setMapOutputKeyClass(Text.class);
        job.setMapOutputValueClass(DoubleWritable.class);

        job.setOutputKeyClass(DoubleWritable.class);
        job.setOutputValueClass(Text.class);

        FileInputFormat.addInputPath(job, new Path(args[0]));
        FileOutputFormat.setOutputPath(job, new Path(args[1]));

        boolean result = job.waitForCompletion(true);

        if (result) {
            Path fileNamePath = new Path(args[1] + "/part-r-00000");

            FileSystem fileSystem = fileNamePath.getFileSystem(job.getConfiguration());

            if (fileSystem.exists(fileNamePath)) {

                List<OutputRecord> top = new ArrayList<OutputRecord>();

                FSDataInputStream fsDataInputStream = fileSystem.open(fileNamePath);
                LineReader lineReader = new LineReader(fsDataInputStream);

                Text tmp = new Text();
                while (lineReader.readLine(tmp) > 0) {
                    String[] lines = tmp.toString().split("\\s+");
                    OutputRecord outputRecord = new OutputRecord(lines[1], Double.parseDouble(lines[0]));
                    top.add(outputRecord);
                }

                fsDataInputStream.close();

                Collections.sort(top);

                System.out.println("\n\n\nTop 10 in PageRank:");
                for (int i = 0; i < 10; ++i) {
                    System.out.println(top.get(i));
                }
                System.out.println("\nВот как то так...\n\n");
            }
        }

        return result ? 0 : 1;
    }