當前位置: 首頁>>代碼示例>>Java>>正文


Java JobInstance.JobStep方法代碼示例

本文整理匯總了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;
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:27,代碼來源:JobInstanceExtractor.java

示例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;
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:27,代碼來源:JobService.java

示例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;
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:34,代碼來源:JobInfoConverter.java

示例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);
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:10,代碼來源:JobInfoConverterTest.java


注:本文中的org.apache.kylin.job.JobInstance.JobStep方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。