@Test public void testSorting() throws Exception { File booksFile = getTestTempFile("books.tsv"); File outputDir = getTestTempDir("output"); outputDir.delete(); writeLines(booksFile, readLines("/two/books.tsv")); SecondarySortBookSort bookSort = new SecondarySortBookSort(); Configuration conf = new Configuration(); bookSort.setConf(conf); bookSort.run(new String[] { "--input", booksFile.getAbsolutePath(), "--output", outputDir.getAbsolutePath() }); File outputFile = new File(outputDir, "part-r-00000"); if (!outputFile.exists()) { fail(); } CenturyAndTitle[] centuryAndTitlesFromInput = asListFromInput(booksFile); CenturyAndTitle[] centuryAndTitlesFromHadoop = asListFromHadoopOut(outputFile); Arrays.sort(centuryAndTitlesFromInput); assertTrue(Arrays.deepEquals(centuryAndTitlesFromInput, centuryAndTitlesFromHadoop)); }
@Override public int run(String[] args) throws Exception { Map<String,String> parsedArgs = parseArgs(args); Path inputPath = new Path(parsedArgs.get("--input")); Path outputPath = new Path(parsedArgs.get("--output")); return 0; }
SecondarySortBookSort extends HadoopJob { @Override public int run(String[] args) throws Exception { Map<String,String> parsedArgs = parseArgs(args); Path inputPath = new Path(parsedArgs.get("--input")); Path outputPath = new Path(parsedArgs.get("--output")); return 0; } }
SecondarySortBookSort extends HadoopJob { @Override public int run(String[] args) throws Exception { Map<String,String> parsedArgs = parseArgs(args); Path inputPath = new Path(parsedArgs.get("--input")); Path outputPath = new Path(parsedArgs.get("--output")); return 0; }  }
SecondarySortBookSort extends HadoopJob { @Override public int run(String[] args) throws Exception { Map<String,String> parsedArgs = parseArgs(args); Path inputPath = new Path(parsedArgs.get("--input")); Path outputPath = new Path(parsedArgs.get("--output")); return 0; }  @Override int run(String[] args); }
SecondarySortBookSort extends HadoopJob { @Override public int run(String[] args) throws Exception { Map<String,String> parsedArgs = parseArgs(args); Path inputPath = new Path(parsedArgs.get("--input")); Path outputPath = new Path(parsedArgs.get("--output")); return 0; }  @Override int run(String[] args);  }