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;
 }
 private Map<String, Class<?>[]> getConfigToElDefMap(StageRuntime stageRuntime) {
   Map<String, Class<?>[]> configToElDefMap = new HashMap<>();
   for (ConfigDefinition configDefinition : stageRuntime.getDefinition().getConfigDefinitions()) {
     configToElDefMap.put(
         configDefinition.getFieldName(), ElUtil.getElDefClassArray(configDefinition.getElDefs()));
     if (configDefinition.getModel() != null
         && configDefinition.getModel().getConfigDefinitions() != null) {
       for (ConfigDefinition configDef : configDefinition.getModel().getConfigDefinitions()) {
         configToElDefMap.put(
             configDef.getFieldName(), ElUtil.getElDefClassArray(configDef.getElDefs()));
       }
     }
   }
   return configToElDefMap;
 }