Java 类org.apache.hadoop.mapred.JobQueueInfo 实例源码

项目:hadoop-2.6.0-cdh5.4.3    文件:TestJobSummary.java   
/**
 * Submit the job in different queue and verifying 
 * the job queue information in job summary 
 * after job is completed.
 */
@Test
public void testJobQueueInfoInJobSummary() throws IOException, 
InterruptedException {
  SleepJob job = new SleepJob();
  job.setConf(conf);
  conf = job.setupJobConf(2, 1, 4000, 4000, 100, 100);
  conf.setBoolean("mapreduce.job.complete.cancel.delegation.tokens", false);
  JobConf jobConf = new JobConf(conf);
  JobQueueInfo [] queues = jobClient.getQueues();
  for (JobQueueInfo queueInfo : queues ){
    if (!queueInfo.getQueueName().equals("default")) {
      queueName = queueInfo.getQueueName();
      break;
    }
  }
  Assert.assertNotNull("No multiple queues in the cluster.",queueName);
  LOG.info("queueName:" + queueName);
  jobConf.setQueueName(queueName);
  RunningJob runJob = jobClient.submitJob(jobConf);
  JobID jobId = runJob.getID();    
  Assert.assertTrue("Job has not been started for 1 min.", 
      jtClient.isJobStarted(jobId));
  LOG.info("Waiting till the job is completed...");
  Assert.assertTrue("Job has not been completed for 1 min.",
      jtClient.isJobStopped(jobId));
  JobInfo jInfo = remoteJTClient.getJobInfo(jobId);
  Assert.assertEquals("Job has not been succeeded", 
      jInfo.getStatus().getRunState(), JobStatus.SUCCEEDED);
  verifyJobSummaryInfo(jInfo,jobId);
}
项目:hadoop-on-lustre    文件:TestJobSummary.java   
/**
 * Submit the job in different queue and verifying 
 * the job queue information in job summary 
 * after job is completed.
 */
@Test
public void testJobQueueInfoInJobSummary() throws IOException, 
InterruptedException {
  SleepJob job = new SleepJob();
  job.setConf(conf);
  conf = job.setupJobConf(2, 1, 4000, 4000, 100, 100);
  conf.setBoolean("mapreduce.job.complete.cancel.delegation.tokens", false);
  JobConf jobConf = new JobConf(conf);
  JobQueueInfo [] queues = jobClient.getQueues();
  for (JobQueueInfo queueInfo : queues ){
    if (!queueInfo.getQueueName().equals("default")) {
      queueName = queueInfo.getQueueName();
      break;
    }
  }
  Assert.assertNotNull("No multiple queues in the cluster.",queueName);
  LOG.info("queueName:" + queueName);
  jobConf.setQueueName(queueName);
  RunningJob runJob = jobClient.submitJob(jobConf);
  JobID jobId = runJob.getID();    
  Assert.assertTrue("Job has not been started for 1 min.", 
      jtClient.isJobStarted(jobId));
  LOG.info("Waiting till the job is completed...");
  Assert.assertTrue("Job has not been completed for 1 min.",
      jtClient.isJobStopped(jobId));
  JobInfo jInfo = remoteJTClient.getJobInfo(jobId);
  Assert.assertEquals("Job has not been succeeded", 
      jInfo.getStatus().getRunState(), JobStatus.SUCCEEDED);
  verifyJobSummaryInfo(jInfo,jobId);
}
项目:hanoi-hadoop-2.0.0-cdh    文件:TestJobSummary.java   
/**
 * Submit the job in different queue and verifying 
 * the job queue information in job summary 
 * after job is completed.
 */
@Test
public void testJobQueueInfoInJobSummary() throws IOException, 
InterruptedException {
  SleepJob job = new SleepJob();
  job.setConf(conf);
  conf = job.setupJobConf(2, 1, 4000, 4000, 100, 100);
  conf.setBoolean("mapreduce.job.complete.cancel.delegation.tokens", false);
  JobConf jobConf = new JobConf(conf);
  JobQueueInfo [] queues = jobClient.getQueues();
  for (JobQueueInfo queueInfo : queues ){
    if (!queueInfo.getQueueName().equals("default")) {
      queueName = queueInfo.getQueueName();
      break;
    }
  }
  Assert.assertNotNull("No multiple queues in the cluster.",queueName);
  LOG.info("queueName:" + queueName);
  jobConf.setQueueName(queueName);
  RunningJob runJob = jobClient.submitJob(jobConf);
  JobID jobId = runJob.getID();    
  Assert.assertTrue("Job has not been started for 1 min.", 
      jtClient.isJobStarted(jobId));
  LOG.info("Waiting till the job is completed...");
  Assert.assertTrue("Job has not been completed for 1 min.",
      jtClient.isJobStopped(jobId));
  JobInfo jInfo = remoteJTClient.getJobInfo(jobId);
  Assert.assertEquals("Job has not been succeeded", 
      jInfo.getStatus().getRunState(), JobStatus.SUCCEEDED);
  verifyJobSummaryInfo(jInfo,jobId);
}
项目:hortonworks-extension    文件:TestJobSummary.java   
/**
 * Submit the job in different queue and verifying 
 * the job queue information in job summary 
 * after job is completed.
 */
@Test
public void testJobQueueInfoInJobSummary() throws IOException, 
InterruptedException {
  SleepJob job = new SleepJob();
  job.setConf(conf);
  conf = job.setupJobConf(2, 1, 4000, 4000, 100, 100);
  conf.setBoolean("mapreduce.job.complete.cancel.delegation.tokens", false);
  JobConf jobConf = new JobConf(conf);
  JobQueueInfo [] queues = jobClient.getQueues();
  for (JobQueueInfo queueInfo : queues ){
    if (!queueInfo.getQueueName().equals("default")) {
      queueName = queueInfo.getQueueName();
      break;
    }
  }
  Assert.assertNotNull("No multiple queues in the cluster.",queueName);
  LOG.info("queueName:" + queueName);
  jobConf.setQueueName(queueName);
  RunningJob runJob = jobClient.submitJob(jobConf);
  JobID jobId = runJob.getID();    
  Assert.assertTrue("Job has not been started for 1 min.", 
      jtClient.isJobStarted(jobId));
  LOG.info("Waiting till the job is completed...");
  Assert.assertTrue("Job has not been completed for 1 min.",
      jtClient.isJobStopped(jobId));
  JobInfo jInfo = remoteJTClient.getJobInfo(jobId);
  Assert.assertEquals("Job has not been succeeded", 
      jInfo.getStatus().getRunState(), JobStatus.SUCCEEDED);
  verifyJobSummaryInfo(jInfo,jobId);
}
项目:hortonworks-extension    文件:TestJobSummary.java   
/**
 * Submit the job in different queue and verifying 
 * the job queue information in job summary 
 * after job is completed.
 */
@Test
public void testJobQueueInfoInJobSummary() throws IOException, 
InterruptedException {
  SleepJob job = new SleepJob();
  job.setConf(conf);
  conf = job.setupJobConf(2, 1, 4000, 4000, 100, 100);
  conf.setBoolean("mapreduce.job.complete.cancel.delegation.tokens", false);
  JobConf jobConf = new JobConf(conf);
  JobQueueInfo [] queues = jobClient.getQueues();
  for (JobQueueInfo queueInfo : queues ){
    if (!queueInfo.getQueueName().equals("default")) {
      queueName = queueInfo.getQueueName();
      break;
    }
  }
  Assert.assertNotNull("No multiple queues in the cluster.",queueName);
  LOG.info("queueName:" + queueName);
  jobConf.setQueueName(queueName);
  RunningJob runJob = jobClient.submitJob(jobConf);
  JobID jobId = runJob.getID();    
  Assert.assertTrue("Job has not been started for 1 min.", 
      jtClient.isJobStarted(jobId));
  LOG.info("Waiting till the job is completed...");
  Assert.assertTrue("Job has not been completed for 1 min.",
      jtClient.isJobStopped(jobId));
  JobInfo jInfo = remoteJTClient.getJobInfo(jobId);
  Assert.assertEquals("Job has not been succeeded", 
      jInfo.getStatus().getRunState(), JobStatus.SUCCEEDED);
  verifyJobSummaryInfo(jInfo,jobId);
}