本文整理汇总了Java中org.apache.hadoop.mapreduce.v2.app.job.impl.JobImpl.InitTransition类的典型用法代码示例。如果您正苦于以下问题:Java InitTransition类的具体用法?Java InitTransition怎么用?Java InitTransition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InitTransition类属于org.apache.hadoop.mapreduce.v2.app.job.impl.JobImpl包,在下文中一共展示了InitTransition类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testUberDecision
import org.apache.hadoop.mapreduce.v2.app.job.impl.JobImpl.InitTransition; //导入依赖的package包/类
private boolean testUberDecision(Configuration conf) {
JobID jobID = JobID.forName("job_1234567890000_0001");
JobId jobId = TypeConverter.toYarn(jobID);
MRAppMetrics mrAppMetrics = MRAppMetrics.create();
JobImpl job =
new JobImpl(jobId, ApplicationAttemptId.newInstance(
ApplicationId.newInstance(0, 0), 0), conf, mock(EventHandler.class),
null, new JobTokenSecretManager(), new Credentials(), null, null,
mrAppMetrics, null, true, null, 0, null, null, null, null);
InitTransition initTransition = getInitTransition(2);
JobEvent mockJobEvent = mock(JobEvent.class);
initTransition.transition(job, mockJobEvent);
boolean isUber = job.isUber();
return isUber;
}
示例2: getInitTransition
import org.apache.hadoop.mapreduce.v2.app.job.impl.JobImpl.InitTransition; //导入依赖的package包/类
private static InitTransition getInitTransition(final int numSplits) {
InitTransition initTransition = new InitTransition() {
@Override
protected TaskSplitMetaInfo[] createSplits(JobImpl job, JobId jobId) {
TaskSplitMetaInfo[] splits = new TaskSplitMetaInfo[numSplits];
for (int i = 0; i < numSplits; ++i) {
splits[i] = new TaskSplitMetaInfo();
}
return splits;
}
};
return initTransition;
}