本文整理汇总了Java中org.apache.kylin.job.dao.ExecutableOutputPO类的典型用法代码示例。如果您正苦于以下问题:Java ExecutableOutputPO类的具体用法?Java ExecutableOutputPO怎么用?Java ExecutableOutputPO使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExecutableOutputPO类属于org.apache.kylin.job.dao包,在下文中一共展示了ExecutableOutputPO类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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);
}
}
示例3: addJobOutput
import org.apache.kylin.job.dao.ExecutableOutputPO; //导入依赖的package包/类
private void addJobOutput(AbstractExecutable executable) throws PersistentException {
ExecutableOutputPO executableOutputPO = new ExecutableOutputPO();
executableOutputPO.setUuid(executable.getId());
executableDao.addJobOutput(executableOutputPO);
if (executable instanceof DefaultChainedExecutable) {
for (AbstractExecutable subTask : ((DefaultChainedExecutable) executable).getTasks()) {
addJobOutput(subTask);
}
}
}
示例4: getOutput
import org.apache.kylin.job.dao.ExecutableOutputPO; //导入依赖的package包/类
public Output getOutput(String uuid) {
try {
final ExecutableOutputPO jobOutput = executableDao.getJobOutput(uuid);
Preconditions.checkArgument(jobOutput != null, "there is no related output for job id:" + uuid);
return parseOutput(jobOutput);
} catch (PersistentException e) {
logger.error("fail to get job output:" + uuid, e);
throw new RuntimeException(e);
}
}
示例5: parseOutput
import org.apache.kylin.job.dao.ExecutableOutputPO; //导入依赖的package包/类
private DefaultOutput parseOutput(ExecutableOutputPO jobOutput) {
final DefaultOutput result = new DefaultOutput();
result.setExtra(jobOutput.getInfo());
result.setState(ExecutableState.valueOf(jobOutput.getStatus()));
result.setVerboseMsg(jobOutput.getContent());
result.setLastModified(jobOutput.getLastModified());
return result;
}
示例6: getAllOutputs
import org.apache.kylin.job.dao.ExecutableOutputPO; //导入依赖的package包/类
public Map<String, Output> getAllOutputs() {
try {
final List<ExecutableOutputPO> jobOutputs = executableDao.getJobOutputs();
HashMap<String, Output> result = Maps.newHashMap();
for (ExecutableOutputPO jobOutput : jobOutputs) {
result.put(jobOutput.getId(), parseOutput(jobOutput));
}
return result;
} catch (PersistentException e) {
logger.error("fail to get all job output:", e);
throw new RuntimeException(e);
}
}
示例7: 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);
}
}
示例8: 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);
}
}
示例9: getJobOutput
import org.apache.kylin.job.dao.ExecutableOutputPO; //导入依赖的package包/类
public ExecutableOutputPO getJobOutput(String jobId) {
try {
return executableDao.getJobOutput(jobId);
} catch (PersistentException e) {
logger.error("Can't get output of Job " + jobId);
throw new RuntimeException(e);
}
}
示例10: 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);
}
}
示例11: 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);
}
}
示例12: addJobInfo
import org.apache.kylin.job.dao.ExecutableOutputPO; //导入依赖的package包/类
public void addJobInfo(String id, Map<String, String> info) {
if (info == null) {
return;
}
// post process
if (info.containsKey(MR_JOB_ID) && !info.containsKey(ExecutableConstants.YARN_APP_ID)) {
String jobId = info.get(MR_JOB_ID);
if (jobId.startsWith("job_")) {
info.put(YARN_APP_ID, jobId.replace("job_", "application_"));
}
}
if (info.containsKey(YARN_APP_ID) && !StringUtils.isEmpty(config.getJobTrackingURLPattern())) {
String pattern = config.getJobTrackingURLPattern();
try {
String newTrackingURL = String.format(pattern, info.get(YARN_APP_ID));
info.put(YARN_APP_URL, newTrackingURL);
} catch (IllegalFormatException ife) {
logger.error("Illegal tracking url pattern: " + config.getJobTrackingURLPattern());
}
}
try {
ExecutableOutputPO output = executableDao.getJobOutput(id);
Preconditions.checkArgument(output != null, "there is no related output for job id:" + id);
output.getInfo().putAll(info);
executableDao.updateJobOutput(output);
} catch (PersistentException e) {
logger.error("error update job info, id:" + id + " info:" + info.toString());
throw new RuntimeException(e);
}
}
示例13: addJobOutput
import org.apache.kylin.job.dao.ExecutableOutputPO; //导入依赖的package包/类
private void addJobOutput(AbstractExecutable executable) throws PersistentException {
ExecutableOutputPO executableOutputPO = new ExecutableOutputPO();
executableOutputPO.setUuid(executable.getId());
executableDao.addJobOutput(executableOutputPO);
if (executable instanceof DefaultChainedExecutable) {
for (AbstractExecutable subTask: ((DefaultChainedExecutable) executable).getTasks()) {
addJobOutput(subTask);
}
}
}
示例14: getOutput
import org.apache.kylin.job.dao.ExecutableOutputPO; //导入依赖的package包/类
public Output getOutput(String uuid) {
try {
final ExecutableOutputPO jobOutput = executableDao.getJobOutput(uuid);
Preconditions.checkArgument(jobOutput != null, "there is no related output for job id:" + uuid);
final DefaultOutput result = new DefaultOutput();
result.setExtra(jobOutput.getInfo());
result.setState(ExecutableState.valueOf(jobOutput.getStatus()));
result.setVerboseMsg(jobOutput.getContent());
result.setLastModified(jobOutput.getLastModified());
return result;
} catch (PersistentException e) {
logger.error("fail to get job output:" + uuid, e);
throw new RuntimeException(e);
}
}
示例15: addJobInfo
import org.apache.kylin.job.dao.ExecutableOutputPO; //导入依赖的package包/类
public void addJobInfo(String id, Map<String, String> info) {
if (info == null) {
return;
}
try {
ExecutableOutputPO output = executableDao.getJobOutput(id);
Preconditions.checkArgument(output != null, "there is no related output for job id:" + id);
output.getInfo().putAll(info);
executableDao.updateJobOutput(output);
} catch (PersistentException e) {
logger.error("error update job info, id:" + id + " info:" + info.toString());
throw new RuntimeException(e);
}
}