Java 类org.apache.hadoop.mapreduce.v2.app.job.event.JobSetupCompletedEvent 实例源码

项目:hadoop    文件:CommitterEventHandler.java   
@SuppressWarnings("unchecked")
protected void handleJobSetup(CommitterJobSetupEvent event) {
  try {
    committer.setupJob(event.getJobContext());
    context.getEventHandler().handle(
        new JobSetupCompletedEvent(event.getJobID()));
  } catch (Exception e) {
    LOG.warn("Job setup failed", e);
    context.getEventHandler().handle(new JobSetupFailedEvent(
        event.getJobID(), StringUtils.stringifyException(e)));
  }
}
项目:aliyun-oss-hadoop-fs    文件:CommitterEventHandler.java   
@SuppressWarnings("unchecked")
protected void handleJobSetup(CommitterJobSetupEvent event) {
  try {
    committer.setupJob(event.getJobContext());
    context.getEventHandler().handle(
        new JobSetupCompletedEvent(event.getJobID()));
  } catch (Exception e) {
    LOG.warn("Job setup failed", e);
    context.getEventHandler().handle(new JobSetupFailedEvent(
        event.getJobID(), StringUtils.stringifyException(e)));
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestJobImpl.java   
@Test
public void testJobPriorityUpdate() throws Exception {
  Configuration conf = new Configuration();
  AsyncDispatcher dispatcher = new AsyncDispatcher();
  Priority submittedPriority = Priority.newInstance(5);

  AppContext mockContext = mock(AppContext.class);
  when(mockContext.hasSuccessfullyUnregistered()).thenReturn(false);
  JobImpl job = createStubbedJob(conf, dispatcher, 2, mockContext);

  JobId jobId = job.getID();
  job.handle(new JobEvent(jobId, JobEventType.JOB_INIT));
  assertJobState(job, JobStateInternal.INITED);
  job.handle(new JobStartEvent(jobId));
  assertJobState(job, JobStateInternal.SETUP);
  // Update priority of job to 5, and it will be updated
  job.setJobPriority(submittedPriority);
  Assert.assertEquals(submittedPriority, job.getReport().getJobPriority());

  job.handle(new JobSetupCompletedEvent(jobId));
  assertJobState(job, JobStateInternal.RUNNING);

  // Update priority of job to 8, and see whether its updated
  Priority updatedPriority = Priority.newInstance(8);
  job.setJobPriority(updatedPriority);
  assertJobState(job, JobStateInternal.RUNNING);
  Priority jobPriority = job.getReport().getJobPriority();
  Assert.assertNotNull(jobPriority);

  // Verify whether changed priority is same as what is set in Job.
  Assert.assertEquals(updatedPriority, jobPriority);
}
项目:big-c    文件:CommitterEventHandler.java   
@SuppressWarnings("unchecked")
protected void handleJobSetup(CommitterJobSetupEvent event) {
  try {
    committer.setupJob(event.getJobContext());
    context.getEventHandler().handle(
        new JobSetupCompletedEvent(event.getJobID()));
  } catch (Exception e) {
    LOG.warn("Job setup failed", e);
    context.getEventHandler().handle(new JobSetupFailedEvent(
        event.getJobID(), StringUtils.stringifyException(e)));
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:CommitterEventHandler.java   
@SuppressWarnings("unchecked")
protected void handleJobSetup(CommitterJobSetupEvent event) {
  try {
    committer.setupJob(event.getJobContext());
    context.getEventHandler().handle(
        new JobSetupCompletedEvent(event.getJobID()));
  } catch (Exception e) {
    LOG.warn("Job setup failed", e);
    context.getEventHandler().handle(new JobSetupFailedEvent(
        event.getJobID(), StringUtils.stringifyException(e)));
  }
}
项目:hadoop-plus    文件:CommitterEventHandler.java   
@SuppressWarnings("unchecked")
protected void handleJobSetup(CommitterJobSetupEvent event) {
  try {
    committer.setupJob(event.getJobContext());
    context.getEventHandler().handle(
        new JobSetupCompletedEvent(event.getJobID()));
  } catch (Exception e) {
    LOG.warn("Job setup failed", e);
    context.getEventHandler().handle(new JobSetupFailedEvent(
        event.getJobID(), StringUtils.stringifyException(e)));
  }
}
项目:FlexMap    文件:CommitterEventHandler.java   
@SuppressWarnings("unchecked")
protected void handleJobSetup(CommitterJobSetupEvent event) {
  try {
    committer.setupJob(event.getJobContext());
    context.getEventHandler().handle(
        new JobSetupCompletedEvent(event.getJobID()));
  } catch (Exception e) {
    LOG.warn("Job setup failed", e);
    context.getEventHandler().handle(new JobSetupFailedEvent(
        event.getJobID(), StringUtils.stringifyException(e)));
  }
}
项目:hops    文件:CommitterEventHandler.java   
@SuppressWarnings("unchecked")
protected void handleJobSetup(CommitterJobSetupEvent event) {
  try {
    committer.setupJob(event.getJobContext());
    context.getEventHandler().handle(
        new JobSetupCompletedEvent(event.getJobID()));
  } catch (Exception e) {
    LOG.warn("Job setup failed", e);
    context.getEventHandler().handle(new JobSetupFailedEvent(
        event.getJobID(), StringUtils.stringifyException(e)));
  }
}
项目:hops    文件:TestJobImpl.java   
@Test
public void testJobPriorityUpdate() throws Exception {
  Configuration conf = new Configuration();
  AsyncDispatcher dispatcher = new AsyncDispatcher();
  Priority submittedPriority = Priority.newInstance(5);

  AppContext mockContext = mock(AppContext.class);
  when(mockContext.hasSuccessfullyUnregistered()).thenReturn(false);
  JobImpl job = createStubbedJob(conf, dispatcher, 2, mockContext);

  JobId jobId = job.getID();
  job.handle(new JobEvent(jobId, JobEventType.JOB_INIT));
  assertJobState(job, JobStateInternal.INITED);
  job.handle(new JobStartEvent(jobId));
  assertJobState(job, JobStateInternal.SETUP);
  // Update priority of job to 5, and it will be updated
  job.setJobPriority(submittedPriority);
  Assert.assertEquals(submittedPriority, job.getReport().getJobPriority());

  job.handle(new JobSetupCompletedEvent(jobId));
  assertJobState(job, JobStateInternal.RUNNING);

  // Update priority of job to 8, and see whether its updated
  Priority updatedPriority = Priority.newInstance(8);
  job.setJobPriority(updatedPriority);
  assertJobState(job, JobStateInternal.RUNNING);
  Priority jobPriority = job.getReport().getJobPriority();
  Assert.assertNotNull(jobPriority);

  // Verify whether changed priority is same as what is set in Job.
  Assert.assertEquals(updatedPriority, jobPriority);
}
项目:hadoop-TCP    文件:CommitterEventHandler.java   
@SuppressWarnings("unchecked")
protected void handleJobSetup(CommitterJobSetupEvent event) {
  try {
    committer.setupJob(event.getJobContext());
    context.getEventHandler().handle(
        new JobSetupCompletedEvent(event.getJobID()));
  } catch (Exception e) {
    LOG.warn("Job setup failed", e);
    context.getEventHandler().handle(new JobSetupFailedEvent(
        event.getJobID(), StringUtils.stringifyException(e)));
  }
}
项目:hardfs    文件:CommitterEventHandler.java   
@SuppressWarnings("unchecked")
protected void handleJobSetup(CommitterJobSetupEvent event) {
  try {
    committer.setupJob(event.getJobContext());
    context.getEventHandler().handle(
        new JobSetupCompletedEvent(event.getJobID()));
  } catch (Exception e) {
    LOG.warn("Job setup failed", e);
    context.getEventHandler().handle(new JobSetupFailedEvent(
        event.getJobID(), StringUtils.stringifyException(e)));
  }
}
项目:hadoop-on-lustre2    文件:CommitterEventHandler.java   
@SuppressWarnings("unchecked")
protected void handleJobSetup(CommitterJobSetupEvent event) {
  try {
    committer.setupJob(event.getJobContext());
    context.getEventHandler().handle(
        new JobSetupCompletedEvent(event.getJobID()));
  } catch (Exception e) {
    LOG.warn("Job setup failed", e);
    context.getEventHandler().handle(new JobSetupFailedEvent(
        event.getJobID(), StringUtils.stringifyException(e)));
  }
}