public void syncDigestsOfJob(String uuid) throws PersistentException { executableDao.syncDigestsOfJob(uuid); }
public void reloadAll() throws IOException { executableDao.reloadAll(); }
public ExecutablePO updateJob(ExecutablePO job) throws PersistentException { try { if (getJob(job.getUuid()) == null) { throw new IllegalArgumentException("job id:" + job.getUuid() + " does not exist"); } writeJobResource(pathOfJob(job), job); executableDigestMap.put(job.getId(), job); return job; } catch (IOException e) { logger.error("error update job:" + job.getUuid(), e); throw new PersistentException(e); } }
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); } }
public void addJobOutput(ExecutableOutputPO output) throws PersistentException { try { output.setLastModified(0); writeJobOutputResource(pathOfJobOutput(output.getUuid()), output); if (!isTaskExecutableOutput(output.getUuid())) executableOutputDigestMap.put(output.getUuid(), output); } catch (IOException e) { logger.error("error update job output id:" + output.getUuid(), e); throw new PersistentException(e); } }
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); } }
private void extractJobInfo(String taskId, File destDir) throws Exception { final Map<String, String> jobInfo = executableDao.getJobOutput(taskId).getInfo(); if (jobInfo.containsKey(ExecutableConstants.MR_JOB_ID)) { String mrJobId = jobInfo.get(ExecutableConstants.MR_JOB_ID); FileUtils.forceMkdir(destDir); String[] mrJobArgs = { "-mrJobId", mrJobId, "-destDir", destDir.getAbsolutePath(), "-compress", "false", "-submodule", "true" }; new MrJobInfoExtractor().execute(mrJobArgs); } }
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); } } }
private ExecutableManager(KylinConfig config) { logger.info("Using metadata url: " + config); this.config = config; this.executableDao = ExecutableDao.getInstance(config); }
public ExecutablePO getJob(String uuid) throws PersistentException { try { return readJobResource(pathOfJob(uuid)); } catch (IOException e) { logger.error("error get job:" + uuid, e); throw new PersistentException(e); } }
public Map<String, ExecutableOutputPO> getAllOutputDigests(long timeStartInMillis, long timeEndInMillis) { final List<ExecutableOutputPO> jobOutputs = executableDao.getJobOutputDigests(timeStartInMillis, timeEndInMillis); HashMap<String, ExecutableOutputPO> result = Maps.newHashMap(); for (ExecutableOutputPO jobOutput : jobOutputs) { result.put(jobOutput.getId(), jobOutput); } return result; }
static ExecutableDao newInstance(KylinConfig config) throws IOException { return new ExecutableDao(config); }
public void deleteJob(String jobId) { try { executableDao.deleteJob(jobId); } catch (PersistentException e) { logger.error("fail to delete job:" + jobId, e); throw new RuntimeException(e); } }
public List<String> getAllJobIds() { try { return executableDao.getJobIds(); } catch (PersistentException e) { logger.error("error get All Job Ids", e); throw new RuntimeException(e); } }
public List<String> getAllJobIdsInCache() { return executableDao.getJobIdsInCache(); }
public AbstractExecutable getJobDigest(String uuid) { return parseTo(executableDao.getJobDigest(uuid)); }
public Output getOutputDigest(String uuid) { final ExecutableOutputPO jobOutput = executableDao.getJobOutputDigest(uuid); Preconditions.checkArgument(jobOutput != null, "there is no related output for job id:" + uuid); return parseOutput(jobOutput); }
public ExecutablePO addJob(ExecutablePO job) throws PersistentException { try { if (getJob(job.getUuid()) != null) { throw new IllegalArgumentException("job id:" + job.getUuid() + " already exists"); } writeJobResource(pathOfJob(job), job); executableDigestMap.put(job.getId(), job); return job; } catch (IOException e) { logger.error("error save job:" + job.getUuid(), e); throw new PersistentException(e); } }
public void updateJobOutput(ExecutableOutputPO output) throws PersistentException { try { writeJobOutputResource(pathOfJobOutput(output.getUuid()), output); if (!isTaskExecutableOutput(output.getUuid())) executableOutputDigestMap.put(output.getUuid(), output); } catch (IOException e) { logger.error("error update job output id:" + output.getUuid(), e); throw new PersistentException(e); } }