HamaConfiguration conf = new HamaConfiguration();
conf.setInt(requestedGraphJobMaxIterationString, 15);
conf.setInt(semiClusterMaximumVertexCount, 100);
conf.setInt(graphJobMessageSentCount, 100);
conf.setInt(graphJobVertexMaxClusterCount, 1);
GraphJob semiClusterJob = new GraphJob(conf, SemiClusterJobDriver.class);
semiClusterJob
.setVertexOutputWriterClass(SemiClusterVertexOutputWriter.class);
semiClusterJob.setJobName("SemiClusterJob");
semiClusterJob.setVertexClass(SemiClusteringVertex.class);
semiClusterJob.setInputPath(new Path(INPUT));
semiClusterJob.setOutputPath(new Path(OUTPUT));
semiClusterJob.set("hama.graph.self.ref", "true");
semiClusterJob.set("hama.graph.repair", "true");
semiClusterJob.setVertexIDClass(Text.class);
semiClusterJob.setVertexValueClass(SemiClusterMessage.class);
semiClusterJob.setEdgeValueClass(DoubleWritable.class);
semiClusterJob.setInputKeyClass(LongWritable.class);
semiClusterJob.setInputValueClass(Text.class);
semiClusterJob.setInputFormat(TextInputFormat.class);
semiClusterJob.setVertexInputReaderClass(SemiClusterTextReader.class);
semiClusterJob.setPartitioner(HashPartitioner.class);
semiClusterJob.setOutputFormat(TextOutputFormat.class);
semiClusterJob.setOutputKeyClass(Text.class);
semiClusterJob.setOutputValueClass(Text.class);
long startTime = System.currentTimeMillis();
if (semiClusterJob.waitForCompletion(true)) {
System.out.println("Job Finished in "
+ (System.currentTimeMillis() - startTime) / 1000.0 + " seconds");
}
semiClusterOutputChecker();