当前位置: 首页>>代码示例>>Java>>正文


Java ExecutableOutputPO.setStatus方法代码示例

本文整理汇总了Java中org.apache.kylin.job.dao.ExecutableOutputPO.setStatus方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutableOutputPO.setStatus方法的具体用法?Java ExecutableOutputPO.setStatus怎么用?Java ExecutableOutputPO.setStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.kylin.job.dao.ExecutableOutputPO的用法示例。


在下文中一共展示了ExecutableOutputPO.setStatus方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: forceKillJob

import org.apache.kylin.job.dao.ExecutableOutputPO; //导入方法依赖的package包/类
public void forceKillJob(String jobId) {
    try {
        final ExecutableOutputPO jobOutput = executableDao.getJobOutput(jobId);
        jobOutput.setStatus(ExecutableState.ERROR.toString());
        List<ExecutablePO> tasks = executableDao.getJob(jobId).getTasks();

        for (ExecutablePO task : tasks) {
            if (executableDao.getJobOutput(task.getId()).getStatus().equals("SUCCEED")) {
                continue;
            } else if (executableDao.getJobOutput(task.getId()).getStatus().equals("RUNNING")) {
                updateJobOutput(task.getId(), ExecutableState.READY, Maps.<String, String> newHashMap(), "");
            }
            break;
        }
        executableDao.updateJobOutput(jobOutput);
    } catch (PersistentException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:20,代码来源:ExecutableManager.java

示例2: updateJobOutput

import org.apache.kylin.job.dao.ExecutableOutputPO; //导入方法依赖的package包/类
public void updateJobOutput(String jobId, ExecutableState newStatus, Map<String, String> info, String output) {
    try {
        final ExecutableOutputPO jobOutput = executableDao.getJobOutput(jobId);
        Preconditions.checkArgument(jobOutput != null, "there is no related output for job id:" + jobId);
        ExecutableState oldStatus = ExecutableState.valueOf(jobOutput.getStatus());
        if (newStatus != null && oldStatus != newStatus) {
            if (!ExecutableState.isValidStateTransfer(oldStatus, newStatus)) {
                throw new IllegalStateTranferException("there is no valid state transfer from:" + oldStatus + " to:" + newStatus);
            }
            jobOutput.setStatus(newStatus.toString());
        }
        if (info != null) {
            jobOutput.setInfo(info);
        }
        if (output != null) {
            jobOutput.setContent(output);
        }
        executableDao.updateJobOutput(jobOutput);
        logger.info("job id:" + jobId + " from " + oldStatus + " to " + newStatus);
    } catch (PersistentException e) {
        logger.error("error change job:" + jobId + " to " + newStatus.toString());
        throw new RuntimeException(e);
    }
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:25,代码来源:ExecutableManager.java

示例3: updateAllRunningJobsToError

import org.apache.kylin.job.dao.ExecutableOutputPO; //导入方法依赖的package包/类
public void updateAllRunningJobsToError() {
    try {
        final List<ExecutableOutputPO> jobOutputs = executableDao.getJobOutputs();
        for (ExecutableOutputPO executableOutputPO : jobOutputs) {
            if (executableOutputPO.getStatus().equalsIgnoreCase(ExecutableState.RUNNING.toString())) {
                executableOutputPO.setStatus(ExecutableState.ERROR.toString());
                executableDao.updateJobOutput(executableOutputPO);
            }
        }
    } catch (PersistentException e) {
        logger.error("error reset job status from RUNNING to ERROR", e);
        throw new RuntimeException(e);
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:15,代码来源:ExecutableManager.java

示例4: resumeAllRunningJobs

import org.apache.kylin.job.dao.ExecutableOutputPO; //导入方法依赖的package包/类
public void resumeAllRunningJobs() {
    try {
        final List<ExecutableOutputPO> jobOutputs = executableDao.getJobOutputs();
        for (ExecutableOutputPO executableOutputPO : jobOutputs) {
            if (executableOutputPO.getStatus().equalsIgnoreCase(ExecutableState.RUNNING.toString())) {
                executableOutputPO.setStatus(ExecutableState.READY.toString());
                executableDao.updateJobOutput(executableOutputPO);
            }
        }
    } catch (PersistentException e) {
        logger.error("error reset job status from RUNNING to READY", e);
        throw new RuntimeException(e);
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:15,代码来源:ExecutableManager.java

示例5: updateJobOutput

import org.apache.kylin.job.dao.ExecutableOutputPO; //导入方法依赖的package包/类
public void updateJobOutput(String jobId, ExecutableState newStatus, Map<String, String> info, String output) {
    // when 
    if (Thread.currentThread().isInterrupted()) {
        throw new RuntimeException("Current thread is interruptted, aborting");
    }

    try {
        final ExecutableOutputPO jobOutput = executableDao.getJobOutput(jobId);
        Preconditions.checkArgument(jobOutput != null, "there is no related output for job id:" + jobId);
        ExecutableState oldStatus = ExecutableState.valueOf(jobOutput.getStatus());
        if (newStatus != null && oldStatus != newStatus) {
            if (!ExecutableState.isValidStateTransfer(oldStatus, newStatus)) {
                throw new IllegalStateTranferException("there is no valid state transfer from:" + oldStatus + " to:"
                        + newStatus + ", job id: " + jobId);
            }
            jobOutput.setStatus(newStatus.toString());
        }
        if (info != null) {
            jobOutput.setInfo(info);
        }
        if (output != null) {
            jobOutput.setContent(output);
        }
        executableDao.updateJobOutput(jobOutput);
        logger.info("job id:" + jobId + " from " + oldStatus + " to " + newStatus);
    } catch (PersistentException e) {
        logger.error("error change job:" + jobId + " to " + newStatus);
        throw new RuntimeException(e);
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:31,代码来源:ExecutableManager.java

示例6: resetJobOutput

import org.apache.kylin.job.dao.ExecutableOutputPO; //导入方法依赖的package包/类
public void resetJobOutput(String jobId, ExecutableState state, String output) {
    try {
        final ExecutableOutputPO jobOutput = executableDao.getJobOutput(jobId);
        jobOutput.setStatus(state.toString());
        if (output != null) {
            jobOutput.setContent(output);
        }
        executableDao.updateJobOutput(jobOutput);
    } catch (PersistentException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:13,代码来源:ExecutableManager.java


注:本文中的org.apache.kylin.job.dao.ExecutableOutputPO.setStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。