@Test public void testNumberOfVertices() throws Exception { GiraphConfiguration conf = new GiraphConfiguration(); conf.setComputationClass(GiraphHelloWorld.class); conf.setVertexInputFormatClass(IntIntNullTextInputFormat.class); conf.setVertexOutputFormatClass(AdjacencyListTextVertexOutputFormat.class); Iterable<String> results = InternalVertexRunner.run(conf, graphSeed); } }
bspJob.getConfiguration().setVertexInputFormatClass( GeneratedVertexInputFormat.class); bspJob.getConfiguration().setVertexOutputFormatClass( IdWithValueTextOutputFormat.class); bspJob.getConfiguration().setWorkerContextClass(
conf.setVertexOutputFormatClass( (Class<? extends VertexOutputFormat>) Class .forName(cmd.getOptionValue("vof")));
/** * 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 * @param tmpDir file path for storing temporary files. * @param checkpointsDir if set, will use this folder * for storing checkpoints. * @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, File tmpDir, String checkpointsDir) throws Exception { conf.setVertexOutputFormatClass(InMemoryVertexOutputFormat.class); InMemoryVertexOutputFormat.initializeOutputGraph(conf); InternalVertexRunner.run(conf, graph, tmpDir, checkpointsDir); return InMemoryVertexOutputFormat.getOutputGraph(); }
LOG.info("Using vertex output format class " + JsonBase64VertexOutputFormat.class.getName()); configuration.setVertexOutputFormatClass( JsonBase64VertexOutputFormat.class);