assert executions != null;
List<ScriptJob<?>> results = new ArrayList<ScriptJob<?>>();
for (ExecutionScript execution : executions) {
switch (execution.getKind()) {
case COMMAND: {
CommandScript exec = (CommandScript) execution;
String profileName = exec.getProfileName();
CommandScriptHandler handler = profileName == null ? null : commandHandlers.get(profileName);
if (handler == null) {
LOG.debug("Profile {} is not defined in comand script handlers, try wildcard: {}",
profileName,
exec.getId());
handler = commandHandlers.get(CommandScriptHandler.PROFILE_WILDCARD);
}
if (handler == null) {
throw new IOException(MessageFormat.format(
"Profile \"{5}\" is not defined (batch={0}, flow={1}, phase={2}, module={3}, id={4})",
context.getBatchId(),
context.getFlowId(),
context.getPhase().getSymbol(),
exec.getModuleName(),
exec.getId(),
profileName));
}
results.add(new ScriptJob<CommandScript>(exec.resolve(context, handler), handler));
break;
}
case HADOOP: {
HadoopScript exec = (HadoopScript) execution;
results.add(new ScriptJob<HadoopScript>(exec.resolve(context, hadoopHandler), hadoopHandler));
break;
}
default:
throw new AssertionError(MessageFormat.format(
"Unknown execution script: {0}",