SimpleCheckpoint.SimpleCheckpointVertexWorkerContext.class);
conf.setMasterComputeClass(
SimpleCheckpoint.SimpleCheckpointVertexMasterCompute.class);
conf.setVertexInputFormatClass(SimpleSuperstepVertexInputFormat.class);
conf.setVertexOutputFormatClass(SimpleSuperstepVertexOutputFormat.class);
GiraphJob job = prepareJob("testVertexBalancer", conf, outputPath);
job.getConfiguration().set(
PartitionBalancer.PARTITION_BALANCE_ALGORITHM,
PartitionBalancer.VERTICES_BALANCE_ALGORITHM);
assertTrue(job.run(true));
FileSystem hdfs = FileSystem.get(job.getConfiguration());
conf = new GiraphConfiguration();
conf.setComputationClass(
SimpleCheckpoint.SimpleCheckpointComputation.class);
conf.setWorkerContextClass(
SimpleCheckpoint.SimpleCheckpointVertexWorkerContext.class);
conf.setMasterComputeClass(
SimpleCheckpoint.SimpleCheckpointVertexMasterCompute.class);
conf.setVertexInputFormatClass(SimpleSuperstepVertexInputFormat.class);
conf.setVertexOutputFormatClass(SimpleSuperstepVertexOutputFormat.class);
outputPath = getTempPath("testHashPartitioner");
job = prepareJob("testHashPartitioner", conf, outputPath);
assertTrue(job.run(true));
verifyOutput(hdfs, outputPath);
outputPath = getTempPath("testSuperstepHashPartitioner");
conf = new GiraphConfiguration();
conf.setComputationClass(
SimpleCheckpoint.SimpleCheckpointComputation.class);
conf.setWorkerContextClass(
SimpleCheckpoint.SimpleCheckpointVertexWorkerContext.class);
conf.setMasterComputeClass(
SimpleCheckpoint.SimpleCheckpointVertexMasterCompute.class);
conf.setVertexInputFormatClass(SimpleSuperstepVertexInputFormat.class);
conf.setVertexOutputFormatClass(SimpleSuperstepVertexOutputFormat.class);
job = prepareJob("testSuperstepHashPartitioner", conf, outputPath);
job.getConfiguration().setGraphPartitionerFactoryClass(
SuperstepHashPartitionerFactory.class);
assertTrue(job.run(true));
verifyOutput(hdfs, outputPath);
job = new GiraphJob("testHashRangePartitioner");
setupConfiguration(job);
job.getConfiguration().setComputationClass(
SimpleCheckpoint.SimpleCheckpointComputation.class);
job.getConfiguration().setWorkerContextClass(
SimpleCheckpoint.SimpleCheckpointVertexWorkerContext.class);
job.getConfiguration().setMasterComputeClass(
SimpleCheckpoint.SimpleCheckpointVertexMasterCompute.class);
job.getConfiguration().setVertexInputFormatClass(
SimpleSuperstepVertexInputFormat.class);
job.getConfiguration().setVertexOutputFormatClass(
SimpleSuperstepVertexOutputFormat.class);
job.getConfiguration().setGraphPartitionerFactoryClass(
HashRangePartitionerFactory.class);
outputPath = getTempPath("testHashRangePartitioner");
removeAndSetOutput(job, outputPath);
assertTrue(job.run(true));
verifyOutput(hdfs, outputPath);
outputPath = getTempPath("testReverseIdSuperstepHashPartitioner");
conf = new GiraphConfiguration();
conf.setComputationClass(
SimpleCheckpoint.SimpleCheckpointComputation.class);
conf.setWorkerContextClass(
SimpleCheckpoint.SimpleCheckpointVertexWorkerContext.class);
conf.setMasterComputeClass(
SimpleCheckpoint.SimpleCheckpointVertexMasterCompute.class);
conf.setVertexInputFormatClass(SimpleSuperstepVertexInputFormat.class);
conf.setVertexOutputFormatClass(SimpleSuperstepVertexOutputFormat.class);
job = prepareJob("testReverseIdSuperstepHashPartitioner", conf,
outputPath);
job.getConfiguration().setGraphPartitionerFactoryClass(
SuperstepHashPartitionerFactory.class);
GeneratedVertexReader.REVERSE_ID_ORDER.set(job.getConfiguration(), true);
assertTrue(job.run(true));
verifyOutput(hdfs, outputPath);
job = new GiraphJob("testSimpleRangePartitioner");
setupConfiguration(job);
job.getConfiguration().setComputationClass(
SimpleCheckpoint.SimpleCheckpointComputation.class);
job.getConfiguration().setWorkerContextClass(
SimpleCheckpoint.SimpleCheckpointVertexWorkerContext.class);
job.getConfiguration().setMasterComputeClass(
SimpleCheckpoint.SimpleCheckpointVertexMasterCompute.class);
job.getConfiguration().setVertexInputFormatClass(
SimpleSuperstepVertexInputFormat.class);
job.getConfiguration().setVertexOutputFormatClass(
SimpleSuperstepVertexOutputFormat.class);
job.getConfiguration().setGraphPartitionerFactoryClass(
SimpleLongRangePartitionerFactory.class);
long readerVertices =
READER_VERTICES.getWithDefault(job.getConfiguration(), -1L);
job.getConfiguration().setLong(
GiraphConstants.PARTITION_VERTEX_KEY_SPACE_SIZE, readerVertices);
outputPath = getTempPath("testSimpleRangePartitioner");
removeAndSetOutput(job, outputPath);
assertTrue(job.run(true));
verifyOutput(hdfs, outputPath);
}