container/src/main/java/com/streamsets/datacollector/validation/PipelineConfigurationValidator.java
private void propagateRuntimeConfiguration() {
    // If pipeline wasn't loaded or there if there are no stages, there is nothing to propagate
    if(pipelineBean == null || pipelineBean.getPipelineStageBeans() == null) {
      return;
    }

    for(StageBean stageBean : pipelineBean.getPipelineStageBeans().getStages()) {
      for(ServiceDependencyDefinition serviceDependency: stageBean.getDefinition().getServices()) {

        ServiceBean stageService = stageBean.getService(serviceDependency.getService());
        if (stageService == null){
          continue;
        }
        ServiceConfiguration serviceConfiguration = stageService.getConf();
        List<Config> configs = serviceConfiguration.getConfiguration();

        // Simply remove all RUNTIME configs
        configs.removeAll(
            serviceDependency.getConfiguration().keySet().stream()
                .map(serviceConfiguration::getConfig)
                .collect(Collectors.toList())
        );

        // And insert them with the stage-instance-constant values
        serviceDependency.getConfiguration().forEach((key, value) -> configs.add(new Config(key, value)));

        // And overwrite the new state
        serviceConfiguration.setConfig(configs);
      }
    }
  }
private void propagateRuntimeConfiguration() {
    // If pipeline wasn't loaded or there if there are no stages, there is nothing to propagate
    if(pipelineBean == null || pipelineBean.getPipelineStageBeans() == null) {
      return;
    }

    for(StageBean stageBean : pipelineBean.getPipelineStageBeans().getStages()) {
      for(ServiceDependencyDefinition serviceDependency: stageBean.getDefinition().getServices()) {

        ServiceBean stageService = stageBean.getService(serviceDependency.getService());
        if (stageService == null){
          continue;
        }
        ServiceConfiguration serviceConfiguration = stageService.getConf();
        List<Config> configs = serviceConfiguration.getConfiguration();

        // Simply remove all RUNTIME configs
        configs.removeAll(
            serviceDependency.getConfiguration().keySet().stream()
                .map(serviceConfiguration::getConfig)
                .collect(Collectors.toList())
        );

        // And insert them with the stage-instance-constant values
        serviceDependency.getConfiguration().forEach((key, value) -> configs.add(new Config(key, value)));

        // And overwrite the new state
        serviceConfiguration.setConfig(configs);
      }
    }
  }
private void propagateRuntimeConfiguration ( ) { // If pipeline wasn't loaded or there if there are no stages, there is nothing to propagate if ( pipelineBean == null || pipelineBean . getPipelineStageBeans ( ) == null ) { return ; } for ( StageBean stageBean : pipelineBean . getPipelineStageBeans ( ) . getStages ( ) ) { for ( ServiceDependencyDefinition serviceDependency : stageBean . getDefinition ( ) . getServices ( ) ) { ServiceBean stageService = stageBean . getService ( serviceDependency . getService ( ) ) ; if ( stageService == null ) { continue ; } ServiceConfiguration serviceConfiguration = stageService . getConf ( ) ; List < Config > configs = serviceConfiguration . getConfiguration ( ) ; // Simply remove all RUNTIME configs configs . removeAll ( serviceDependency . getConfiguration ( ) . keySet ( ) . stream ( ) . map ( serviceConfiguration :: getConfig ) . collect ( Collectors . toList ( ) ) ) ; // And insert them with the stage-instance-constant values serviceDependency . getConfiguration ( ) . forEach ( ( key , value ) -> configs . add ( new Config ( key , value ) ) ) ; // And overwrite the new state serviceConfiguration . setConfig ( configs ) ; } } }
We have special type of a ConfigDef called RUNTIME. This config is never displayed in UI and instead it's values
are supplied at "runtime". This method is the "runtime" method that propagates them.
We have special type of a ConfigDef called RUNTIME . This config is never displayed in UI and instead it s values are supplied at runtime . This method is the runtime method that propagates them .