本文整理匯總了Java中org.apache.kylin.job.JobInstance.JobStep方法的典型用法代碼示例。如果您正苦於以下問題:Java JobInstance.JobStep方法的具體用法?Java JobInstance.JobStep怎麽用?Java JobInstance.JobStep使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.kylin.job.JobInstance
的用法示例。
在下文中一共展示了JobInstance.JobStep方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: parseToJobStep
import org.apache.kylin.job.JobInstance; //導入方法依賴的package包/類
private JobInstance.JobStep parseToJobStep(AbstractExecutable task, int i, Output stepOutput) {
Preconditions.checkNotNull(stepOutput);
JobInstance.JobStep result = new JobInstance.JobStep();
result.setId(task.getId());
result.setName(task.getName());
result.setSequenceID(i);
result.setStatus(parseToJobStepStatus(stepOutput.getState()));
for (Map.Entry<String, String> entry : stepOutput.getExtra().entrySet()) {
if (entry.getKey() != null && entry.getValue() != null) {
result.putInfo(entry.getKey(), entry.getValue());
}
}
result.setExecStartTime(AbstractExecutable.getStartTime(stepOutput));
result.setExecEndTime(AbstractExecutable.getEndTime(stepOutput));
if (task instanceof ShellExecutable) {
result.setExecCmd(((ShellExecutable) task).getCmd());
}
if (task instanceof MapReduceExecutable) {
result.setExecCmd(((MapReduceExecutable) task).getMapReduceParams());
result.setExecWaitTime(AbstractExecutable.getExtraInfoAsLong(stepOutput, MapReduceExecutable.MAP_REDUCE_WAIT_TIME, 0L) / 1000);
}
if (task instanceof HadoopShellExecutable) {
result.setExecCmd(((HadoopShellExecutable) task).getJobParams());
}
return result;
}
示例2: parseToJobStep
import org.apache.kylin.job.JobInstance; //導入方法依賴的package包/類
private JobInstance.JobStep parseToJobStep(AbstractExecutable task, int i) {
JobInstance.JobStep result = new JobInstance.JobStep();
result.setId(task.getId());
result.setName(task.getName());
result.setSequenceID(i);
result.setStatus(parseToJobStepStatus(task.getStatus()));
final Output output = getExecutableManager().getOutput(task.getId());
for (Map.Entry<String, String> entry : output.getExtra().entrySet()) {
if (entry.getKey() != null && entry.getValue() != null) {
result.putInfo(entry.getKey(), entry.getValue());
}
}
result.setExecStartTime(task.getStartTime());
result.setExecEndTime(task.getEndTime());
if (task instanceof ShellExecutable) {
result.setExecCmd(((ShellExecutable) task).getCmd());
}
if (task instanceof MapReduceExecutable) {
result.setExecCmd(((MapReduceExecutable) task).getMapReduceParams());
result.setExecWaitTime(((MapReduceExecutable) task).getMapReduceWaitTime() / 1000);
}
if (task instanceof HadoopShellExecutable) {
result.setExecCmd(((HadoopShellExecutable) task).getJobParams());
}
return result;
}
示例3: parseToJobStep
import org.apache.kylin.job.JobInstance; //導入方法依賴的package包/類
public static JobInstance.JobStep parseToJobStep(AbstractExecutable task, int i, Output stepOutput) {
JobInstance.JobStep result = new JobInstance.JobStep();
result.setId(task.getId());
result.setName(task.getName());
result.setSequenceID(i);
if (stepOutput == null) {
logger.warn("Cannot found output for task: id={}", task.getId());
return result;
}
result.setStatus(parseToJobStepStatus(stepOutput.getState()));
for (Map.Entry<String, String> entry : stepOutput.getExtra().entrySet()) {
if (entry.getKey() != null && entry.getValue() != null) {
result.putInfo(entry.getKey(), entry.getValue());
}
}
result.setExecStartTime(AbstractExecutable.getStartTime(stepOutput));
result.setExecEndTime(AbstractExecutable.getEndTime(stepOutput));
if (task instanceof ShellExecutable) {
result.setExecCmd(((ShellExecutable) task).getCmd());
}
if (task instanceof MapReduceExecutable) {
result.setExecCmd(((MapReduceExecutable) task).getMapReduceParams());
result.setExecWaitTime(
AbstractExecutable.getExtraInfoAsLong(stepOutput, MapReduceExecutable.MAP_REDUCE_WAIT_TIME, 0L)
/ 1000);
}
if (task instanceof HadoopShellExecutable) {
result.setExecCmd(((HadoopShellExecutable) task).getJobParams());
}
return result;
}
示例4: testParseToJobStep
import org.apache.kylin.job.JobInstance; //導入方法依賴的package包/類
@Test
public void testParseToJobStep() {
TestJob task = new TestJob();
JobInstance.JobStep step = JobInfoConverter.parseToJobStep(task, 0, null);
Assert.assertEquals(step.getStatus(), JobStepStatusEnum.PENDING);
step = JobInfoConverter.parseToJobStep(task, 0, new TestOutput());
Assert.assertEquals(step.getStatus(), JobStepStatusEnum.FINISHED);
}