@Override public synchronized void beginFlow(String flowId, String executionId) throws IOException { if (flowId == null) { throw new IllegalArgumentException("flowId must not be null"); //$NON-NLS-1$ } if (executionId == null) { throw new IllegalArgumentException("executionId must not be null"); //$NON-NLS-1$ } if (closed) { throw new IOException("Lock manager is already closed"); } LockObject other = flowLocks.get(flowId); if (other != null) { YSLOG.error("E41002", batchId, flowId, executionId, lockScope); throw new IOException(MessageFormat.format( "Failed to lock target flow (re-entrant): {0} ({1})", flowId, other.label)); } try { LockObject lock = acquireForFlow(flowId, executionId); if (lock != null) { flowLocks.put(flowId, lock); } } catch (IOException e) { YSLOG.error("E41002", batchId, flowId, executionId, lockScope); throw e; } }
/** * Creates a new instance. * @param lockScope lock scope * @param batchId target batch ID * @param directory base directory for lock files, must exist * @throws IOException if failed to create instance * @throws IllegalArgumentException if some parameters were {@code null} */ FileExecutionLock(Scope lockScope, String batchId, File directory) throws IOException { if (lockScope == null) { throw new IllegalArgumentException("lockScope must not be null"); //$NON-NLS-1$ } if (batchId == null) { throw new IllegalArgumentException("batchId must not be null"); //$NON-NLS-1$ } if (directory == null) { throw new IllegalArgumentException("directory must not be null"); //$NON-NLS-1$ } this.lockScope = lockScope; this.batchId = batchId; this.directory = directory; this.flowLocks = new HashMap<>(); try { this.batchLock = acquireForBatch(); } catch (IOException e) { YSLOG.error("E41001", batchId, lockScope); throw e; } }
private Properties loadBatchConf(ExecutionContext context, ExecutionScript script) throws IOException { assert context != null; String fileName = context.getBatchId() + SUFFIX_CONF; File file = new File(confDirectory, fileName); LOG.debug("Finding multidispatch configuration file: batchId={}, file={}", context.getBatchId(), file); if (file.isFile() == false) { LOG.debug("Missing multidispatch configuration file: batchId={}, file={}", context.getBatchId(), file); return null; } LOG.debug("Loading multidispatch configuration file: batchId={}, file={}", context.getBatchId(), file); try (InputStream in = new FileInputStream(file)) { Properties properties = new Properties(); properties.load(in); return properties; } catch (IOException e) { YSLOG.error(e, "E01001", context.getBatchId(), file.getAbsolutePath()); throw e; } }
YSLOG.error(e, "E00001", user, host, port, privateKey); throw e;
resolved.put(key, value); } catch (IllegalArgumentException e) { YSLOG.error(e, "E10001", profile.getPrefix(), ExecutionScriptHandler.KEY_PROP_PREFIX,
resolved.put(key, value); } catch (IllegalArgumentException e) { YSLOG.error(e, "E10001", profile.getPrefix(), ExecutionScriptHandler.KEY_ENV_PREFIX,
result.profile = YaessProfile.load(properties, result.context); } catch (Exception e) { YSLOG.error(e, "E01001", file.getPath()); throw new IllegalArgumentException(MessageFormat.format( "Invalid profile \"{0}\".", result.script = properties; } catch (Exception e) { YSLOG.error(e, "E01002", script); throw new IllegalArgumentException(MessageFormat.format( "Invalid script \"{0}\".",
System.out.printf(" %s%n", phase.getSymbol()); YSLOG.error(e, "E00001", Arrays.toString(args)); return 1; conf.arguments, conf.definitions, blobs); } catch (Exception e) { YSLOG.error(e, "E00002", conf); return 1; YSLOG.error("E00003", conf); return 1; } catch (Exception e) { YSLOG.error(e, "E00003", conf); return 1; } finally {
private JobStatus poll(ExecutionContext context, JobInfo info) throws IOException, InterruptedException { assert context != null; assert info != null; try { return info.client.getStatus(info.id); } catch (IOException e) { YSLOG.error(e, "E01003", info.script.getBatchId(), info.script.getFlowId(), info.script.getPhase(), info.script.getExecutionId(), info.script.getStageId(), info.client, info.id); throw e; } }
info.client.submit(info.id); } catch (IOException e) { YSLOG.error(e, "E01002", info.script.getBatchId(), info.script.getFlowId(),
context.getBatchId(), context.getFlowId(), context.getExecutionId(), context.getPhase()); } catch (ExitCodeException e) { YSLOG.error("E03001", context.getBatchId(), context.getFlowId(), context.getExecutionId(), context.getPhase()); throw e; } catch (IOException e) { YSLOG.error(e, "E03001", context.getBatchId(), context.getFlowId(), context.getExecutionId(), context.getPhase()); throw e;
getJobLabel(), getServiceLabel(), getTrackingId(context)); } catch (IOException e) { YSLOG.error(e, "E04001", context.getBatchId(), context.getFlowId(), context.getExecutionId(), context.getPhase(), getJobLabel(), getServiceLabel(), getTrackingId(context));