private Map<String, String> buildHadoopProperties( ExecutionContext context, HadoopScript script) throws InterruptedException, IOException { assert context != null; assert script != null; Map<String, String> props = new TreeMap<>(); props.putAll(getProperties(context, script)); props.putAll(script.getHadoopProperties()); props.put(HadoopScriptUtil.PROP_TRACKING_ID, Job.computeTrackingId(context, script)); return props; }
@Override public String toString() { return MessageFormat.format( "Hadoop'{'id={0}, blockers={1}, class={2}, properties={3}, environment={4}'}'", getId(), getBlockerIds(), getClassName(), getHadoopProperties(), getEnvironmentVariables()); }
for (Map.Entry<String, String> entry : getHadoopProperties().entrySet()) { resolvedProperties.put(entry.getKey(), resolver.resolve(entry.getValue()));
properties.setProperty(scriptPrefix + KEY_CLASS_NAME, s.getClassName()); String propPrefix = scriptPrefix + KEY_PROP_PREFIX; for (Map.Entry<String, String> entry : s.getHadoopProperties().entrySet()) { properties.setProperty(propPrefix + entry.getKey(), entry.getValue());
private JobScript convert(ExecutionContext context, HadoopScript script) throws InterruptedException, IOException { assert context != null; assert script != null; JobScript result = new JobScript(); result.setBatchId(context.getBatchId()); result.setFlowId(context.getFlowId()); result.setExecutionId(context.getExecutionId()); result.setPhase(context.getPhase()); result.setArguments(new HashMap<>(context.getArguments())); result.setStageId(script.getId()); result.setMainClassName(script.getClassName()); Map<String, String> props = new HashMap<>(); props.putAll(getProperties(context, script)); props.putAll(script.getHadoopProperties()); props.put(HadoopScriptUtil.PROP_TRACKING_ID, Job.computeTrackingId(context, script)); result.setProperties(props); Map<String, String> env = new HashMap<>(); // NOTE: Handler has only dummy environment variables // env.putAll(getEnvironmentVariables(context, script)); env.putAll(context.getEnvironmentVariables()); env.putAll(script.getEnvironmentVariables()); result.setEnvironmentVariables(env); return result; }