/** * Run Block Application specified within the conf, on a given graph, * locally, in-memory. * * With a boolean flag, you can switch between LocalBlockRunner and * InternalVertexRunner implementations of local in-memory computation. */ public static <I extends WritableComparable, V extends Writable, E extends Writable> TestGraph<I, V, E> runApp( TestGraph<I, V, E> graph, boolean useFullDigraphTests) throws Exception { if (useFullDigraphTests) { return InternalVertexRunner.runWithInMemoryOutput(graph.getConf(), graph); } else { runApp(graph); return graph; } }
/** * Attempts to run the vertex internally in the current JVM, reading and * writing to an in-memory graph. Will start its own zookeeper * instance. * * @param <I> Vertex ID * @param <V> Vertex Value * @param <E> Edge Value * @param conf GiraphClasses specifying which types to use * @param graph input graph * @return Output graph * @throws Exception if anything goes wrong */ public static <I extends WritableComparable, V extends Writable, E extends Writable> TestGraph<I, V, E> runWithInMemoryOutput( GiraphConfiguration conf, TestGraph<I, V, E> graph) throws Exception { // Prepare temporary folders File tmpDir = FileUtils.createTestDir(conf.getComputationName()); try { return runWithInMemoryOutput(conf, graph, tmpDir, null); } finally { FileUtils.delete(tmpDir); } }