/**
* Adjust the configuration to the basic test case
*/
public final Configuration setupConfiguration(GiraphJob job)
throws IOException {
GiraphConfiguration conf = job.getConfiguration();
conf.set("mapred.jar", getJarLocation());
// Allow this test to be run on a real Hadoop setup
if (runningInDistributedMode()) {
System.out.println("setupConfiguration: Sending job to job tracker " +
jobTracker + " with jar path " + getJarLocation()
+ " for " + getName());
conf.set("mapred.job.tracker", jobTracker);
conf.setWorkerConfiguration(getNumWorkers(), getNumWorkers(), 100.0f);
}
else {
System.out.println("setupConfiguration: Using local job runner with " +
"location " + getJarLocation() + " for " + getName());
conf.setWorkerConfiguration(1, 1, 100.0f);
// Single node testing
GiraphConstants.SPLIT_MASTER_WORKER.set(conf, false);
}
conf.setMaxMasterSuperstepWaitMsecs(30 * 1000);
conf.setEventWaitMsecs(3 * 1000);
GiraphConstants.ZOOKEEPER_SERVERLIST_POLL_MSECS.set(conf, 500);
if (getZooKeeperList() != null) {
conf.setZooKeeperConfiguration(getZooKeeperList());
}
// GeneratedInputSplit will generate 5 vertices
conf.setLong(READER_VERTICES, 5);
// Setup pathes for temporary files
Path zookeeperDir = getTempPath("_bspZooKeeper");
Path zkManagerDir = getTempPath("_defaultZkManagerDir");
Path checkPointDir = getTempPath("_checkpoints");
// We might start several jobs per test, so we need to clean up here
FileUtils.deletePath(conf, zookeeperDir);
FileUtils.deletePath(conf, zkManagerDir);
FileUtils.deletePath(conf, checkPointDir);
conf.set(GiraphConstants.ZOOKEEPER_DIR, zookeeperDir.toString());
GiraphConstants.ZOOKEEPER_MANAGER_DIRECTORY.set(conf,
zkManagerDir.toString());
GiraphConstants.CHECKPOINT_DIRECTORY.set(conf, checkPointDir.toString());
return conf;