BuildSketchIndex extends AppFunction { @Override public void run(Parameters p, PrintStream output) throws Exception { if (!(p.containsKey("inputPath") && p.containsKey("indexPath") && p.containsKey("sketchIndexName"))) { System.err.println(getHelpString()); } Job job = getIndexJob(p); if (job != null) { TupleflowAppUtil.runTupleFlowJob(job, p, output); } output.println("Done Indexing."); }  @Override String getName(); @Override String getHelpString(); @Override void run(Parameters p, PrintStream output);  }
@Test public void testSomeMethod() throws Exception { File corpus = FileUtility.createTemporary(); File index = FileUtility.createTemporaryDirectory(); try { makeCorpus(corpus); Parameters idxParams = Parameters.create(); idxParams.set("inputPath", corpus.getAbsolutePath()); idxParams.set("indexPath", index.getAbsolutePath()); (new BuildIndex()).run(idxParams, System.out); Parameters sketchParams = Parameters.create(); sketchParams.set("inputPath", corpus.getAbsolutePath()); sketchParams.set("indexPath", index.getAbsolutePath()); sketchParams.set("sketchIndexName", "sketch-od1-e1-d2"); sketchParams.set("n", 2); sketchParams.set("width", 1); sketchParams.set("ordered", true); sketchParams.set("error", 1.0); sketchParams.set("depth", 2); (new BuildSketchIndex()).run(sketchParams, System.out); sketchParams = Parameters.create(); sketchParams.set("inputPath", corpus.getAbsolutePath()); sketchParams.set("indexPath", index.getAbsolutePath()); sketchParams.set("sketchIndexName", "sketch-od1-e100-d2"); sketchParams.set("n", 2); sketchParams.set("width", 1); sketchParams.set("ordered", true); sketchParams.set("error", 100.0); sketchParams.set("depth", 2); (new BuildSketchIndex()).run(sketchParams, System.out); } finally { Assert.assertTrue(corpus.delete()); FSUtil.deleteDirectory(index); } }