public StageContext( String pipelineName, String rev, List<Stage.Info> pipelineInfo, StageType stageType, boolean isPreview, MetricRegistry metrics, StageRuntime stageRuntime, long pipelineMaxMemory, ExecutionMode executionMode, String resourcesDir) { this.pipelineName = pipelineName; this.rev = rev; this.pipelineInfo = pipelineInfo; this.stageType = stageType; this.isPreview = isPreview; this.metrics = metrics; this.instanceName = stageRuntime.getConfiguration().getInstanceName(); this.outputLanes = ImmutableList.copyOf(stageRuntime.getConfiguration().getOutputLanes()); onRecordError = stageRuntime.getOnRecordError(); this.configToElDefMap = getConfigToElDefMap(stageRuntime); this.constants = stageRuntime.getConstants(); this.pipelineMaxMemory = pipelineMaxMemory; this.executionMode = executionMode; this.resourcesDir = resourcesDir; }