Search in sources :

Example 1 with JobHistoryEventHandler

use of org.apache.hadoop.mapreduce.jobhistory.JobHistoryEventHandler in project hadoop by apache.

the class MRAppMasterTestLaunchTime method createJobHistoryHandler.

@Override
protected EventHandler<JobHistoryEvent> createJobHistoryHandler(AppContext context) {
    return new JobHistoryEventHandler(context, getStartCount()) {

        @Override
        public void handle(JobHistoryEvent event) {
            if (event.getHistoryEvent().getEventType() == EventType.JOB_INITED) {
                JobInitedEvent jie = (JobInitedEvent) event.getHistoryEvent();
                jobLaunchTime.set(jie.getLaunchTime());
            }
            super.handle(event);
        }
    };
}
Also used : JobHistoryEventHandler(org.apache.hadoop.mapreduce.jobhistory.JobHistoryEventHandler) JobInitedEvent(org.apache.hadoop.mapreduce.jobhistory.JobInitedEvent) JobHistoryEvent(org.apache.hadoop.mapreduce.jobhistory.JobHistoryEvent)

Aggregations

JobHistoryEvent (org.apache.hadoop.mapreduce.jobhistory.JobHistoryEvent)1 JobHistoryEventHandler (org.apache.hadoop.mapreduce.jobhistory.JobHistoryEventHandler)1 JobInitedEvent (org.apache.hadoop.mapreduce.jobhistory.JobInitedEvent)1