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; }
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); } }