@Test
public void testBspPageRankWithAggregatorWriter()
throws IOException, InterruptedException, ClassNotFoundException {
Path outputPath = getTempPath(getCallingMethodName());
GiraphConfiguration conf = new GiraphConfiguration();
conf.setComputationClass(SimplePageRankComputation.class);
conf.setAggregatorWriterClass(TextAggregatorWriter.class);
conf.setMasterComputeClass(
SimplePageRankComputation.SimplePageRankMasterCompute.class);
conf.setVertexInputFormatClass(SimplePageRankVertexInputFormat.class);
conf.setVertexOutputFormatClass(
SimplePageRankComputation.SimplePageRankVertexOutputFormat.class);
conf.setWorkerContextClass(
SimplePageRankComputation.SimplePageRankWorkerContext.class);
GiraphJob job = prepareJob(getCallingMethodName(), conf, outputPath);
GiraphConfiguration configuration = job.getConfiguration();
Path aggregatorValues = getTempPath("aggregatorValues");
configuration.setInt(TextAggregatorWriter.FREQUENCY,
TextAggregatorWriter.ALWAYS);
configuration.set(TextAggregatorWriter.FILENAME,
aggregatorValues.toString());
assertTrue(job.run(true));
FileSystem fs = FileSystem.get(configuration);