public NumericTestGraph(GiraphConfiguration conf) { this(new TestGraph<I, V, E>(conf)); }
/** * Initialize this output format - needs to be called before running the * application. Creates new instance of TestGraph * * @param conf Configuration */ public static void initializeOutputGraph(GiraphConfiguration conf) { OUTPUT_GRAPH = new TestGraph(conf); }
private static TestGraph<LongWritable, LongWritable, NullWritable> createTestGraph() { TestGraph<LongWritable, LongWritable, NullWritable> graph = new TestGraph<LongWritable, LongWritable, NullWritable>(createConf()); graph.addVertex(new LongWritable(1), new LongWritable()); graph.addVertex(new LongWritable(2), new LongWritable()); graph.addVertex(new LongWritable(3), new LongWritable()); graph.addVertex(new LongWritable(4), new LongWritable()); graph.addEdge(new LongWritable(1), new LongWritable(2), NullWritable.get()); graph.addEdge(new LongWritable(2), new LongWritable(1), NullWritable.get()); graph.addEdge(new LongWritable(2), new LongWritable(3), NullWritable.get()); graph.addEdge(new LongWritable(3), new LongWritable(2), NullWritable.get()); return graph; }
private static TestGraph<LongWritable, LongWritable, NullWritable> createTestGraph() { TestGraph<LongWritable, LongWritable, NullWritable> graph = new TestGraph<>(createConf()); graph.addVertex(new LongWritable(1), new LongWritable()); graph.addVertex(new LongWritable(2), new LongWritable()); graph.addVertex(new LongWritable(3), new LongWritable()); graph.addVertex(new LongWritable(4), new LongWritable()); graph.addEdge(new LongWritable(1), new LongWritable(2), NullWritable.get()); graph.addEdge(new LongWritable(2), new LongWritable(1), NullWritable.get()); graph.addEdge(new LongWritable(2), new LongWritable(3), NullWritable.get()); graph.addEdge(new LongWritable(3), new LongWritable(2), NullWritable.get()); return graph; }
@Test public void testWorkerMessages() throws Exception { GiraphConfiguration conf = new GiraphConfiguration(); BlockUtils.setAndInitBlockFactoryClass(conf, TestWorkerMessagesBlockFactory.class); TestGraph testGraph = new TestGraph(conf); testGraph.addEdge(new LongWritable(1), new LongWritable(2), NullWritable.get()); LocalBlockRunner.runApp(testGraph); }