*/
public void testDistRaid() throws Exception {
LOG.info("TestDist started.");
// create a dfs and map-reduce cluster
mySetup(3, -1);
MiniMRCluster mr = new MiniMRCluster(4, namenode, 3);
String jobTrackerName = "localhost:" + mr.getJobTrackerPort();
conf.set("mapred.job.tracker", jobTrackerName);
try {
// Create files to be raided
TestRaidNode.createTestFiles(fileSys, RAID_SRC_PATH,
"/raid" + RAID_SRC_PATH, 1, 3, (short)3);
String subDir = RAID_SRC_PATH + "/subdir";
TestRaidNode.createTestFiles(
fileSys, subDir, "/raid" + subDir, 1, 3, (short)3);
// Create RaidShell and raid the files.
RaidShell shell = new RaidShell(conf);
String[] args = new String[3];
args[0] = "-distRaid";
args[1] = RAID_POLICY_NAME;
args[2] = RAID_SRC_PATH;
assertEquals(0, ToolRunner.run(shell, args));
// Check files are raided
checkIfFileRaided(new Path(RAID_SRC_PATH, "file0"));
checkIfFileRaided(new Path(subDir, "file0"));
} finally {
mr.shutdown();
myTearDown();
}
}