code: public static Configuration loadConfiguration(final String configDir, @Nullable final Configuration dynamicProperties) {
  
  		if (configDir == null) {
  			throw new IllegalArgumentException("Given configuration directory is null, cannot load configuration");
  		}
  
  		final File confDirFile = new File(configDir);
  		if (!(confDirFile.exists())) {
  			throw new IllegalConfigurationException(
  				"The given configuration directory name '" + configDir +
  					"' (" + confDirFile.getAbsolutePath() + ") does not describe an existing directory.");
  		}
  
  		// get Flink yaml configuration file
  		final File yamlConfigFile = new File(confDirFile, FLINK_CONF_FILENAME);
  
  		if (!yamlConfigFile.exists()) {
  			throw new IllegalConfigurationException(
  				"The Flink config file '" + yamlConfigFile +
  					"' (" + confDirFile.getAbsolutePath() + ") does not exist.");
  		}
  
  		Configuration configuration = loadYAMLResource(yamlConfigFile);
  
  		if (dynamicProperties != null) {
  			configuration.addAll(dynamicProperties);
  		}
  
  		return configuration;
  	}
docs: Loads the configuration files from the specified directory. If the dynamic properties
  configuration is not null, then it is added to the loaded configuration.
  
  @param configDir directory to load the configuration from
  @param dynamicProperties configuration file containing the dynamic properties. Null if none.
  @return The configuration loaded from the given configuration directory