@Before public void before() throws Exception { String[] expExcludeList = {"java.net.ConnectException", "java.io.IOException"}; cluster = MRCluster.createCluster(conf); cluster.setExcludeExpList(expExcludeList); cluster.setUp(); jtClient = cluster.getJTClient(); remoteJTClient = jtClient.getProxy(); }
@BeforeClass public static void before() throws Exception { String[] excludeExpList = {"java.net.ConnectException", "java.io.IOException"}; cluster = MRCluster.createCluster(conf); cluster.setExcludeExpList(excludeExpList); cluster.setUp(); cSize = cluster.getTTClients().size(); jtClient = cluster.getJTClient(); rtClient = jtClient.getProxy(); gridmixDir = new Path("herriot-gridmix"); UtilsForGridmix.createDirs(gridmixDir, rtClient.getDaemonConf()); }
private void checkGeneratedDataAndJobStatus(long inputSize) throws IOException { LOG.info("Verify the generated data size."); long dataSizeInMB = getDataSizeInMB(new Path(gridmixDir, "input")); Assert.assertTrue( "Generate data has not matched with given size", dataSizeInMB + 0.1 > inputSize || dataSizeInMB - 0.1 < inputSize); JobClient jobClient = jtClient.getClient(); int len = jobClient.getAllJobs().length; LOG.info("Verify the job status after completion of job."); Assert.assertEquals( "Job has not succeeded.", JobStatus.SUCCEEDED, jobClient.getAllJobs()[len - 1].getRunState()); }
/** * Set the invalid mapred local directory location and run the job. Verify the job status. * * @throws Exception - if an error occurs. */ @Test public void testJobStatusForInvalidTaskControllerConf() throws Exception { conf = remoteJTClient.getDaemonConf(); if (conf.get("mapred.task.tracker.task-controller") .equals("org.apache.hadoop.mapred.LinuxTaskController")) { StringBuffer mapredLocalDir = new StringBuffer(); LOG.info("JobConf.MAPRED_LOCAL_DIR_PROPERTY:" + conf.get(JobConf.MAPRED_LOCAL_DIR_PROPERTY)); mapredLocalDir.append(conf.get(JobConf.MAPRED_LOCAL_DIR_PROPERTY)); mapredLocalDir.append(","); mapredLocalDir.append("/mapred/local"); String jobArgs[] = { "-D", "mapred.local.dir=" + mapredLocalDir.toString(), "-m", "1", "-r", "1", "-mt", "1000", "-rt", "1000", "-recordt", "100" }; SleepJob job = new SleepJob(); JobConf jobConf = new JobConf(conf); int exitStatus = ToolRunner.run(jobConf, job, jobArgs); Assert.assertEquals("Exit Code:", 0, exitStatus); UtilsForTests.waitFor(100); JobClient jobClient = jtClient.getClient(); JobID jobId = jobClient.getAllJobs()[0].getJobID(); LOG.info("JobId:" + jobId); if (jobId != null) { JobInfo jInfo = remoteJTClient.getJobInfo(jobId); Assert.assertEquals( "Job has not been succeeded", jInfo.getStatus().getRunState(), JobStatus.SUCCEEDED); } } else { Assert.assertTrue("Linux Task controller not found.", false); } }