Internal non-static method to include configuration.

@param conf
the {@link Configuration} object to merge into the global configuration
8660
private void includeConfigurationInternal(final Configuration conf) {

		if (conf == null) {
			LOG.error("Given configuration object is null, ignoring it...");
			return;
		}

		synchronized (this.confData) {

			final Iterator<String> it = conf.keySet().iterator();

			while (it.hasNext()) {

				final String key = it.next();
				this.confData.put(key, conf.getString(key, ""));
			}
		}
	}
784256
public void configFields(Configuration conf, String[] fields) 
            throws IllegalArgumentException, IOException {
        for (int i = 0; i < fields.length; i++) {
            fields[i] = fields[i].trim();
            if ("".equals(fields[i])) {
                LOG.warn("Column " + (i+1) + " has no header and will be skipped");
            }
        }
    }
810088
public static void disableSerialization(Configuration conf) {
		String ser = conf.get("io.serializations").trim();
		String stToSearch = Pattern.quote("," + TupleSerialization.class.getName());
		ser = ser.replaceAll(stToSearch, "");
		conf.set("io.serializations", ser);
	}
378811
@Override
    public void prepare(Map conf) {
        users = new HashSet<String>();
        if (conf.containsKey(WHITELIST_USERS_CONF)) {
            users.addAll((Collection<String>) conf.get(WHITELIST_USERS_CONF));
        }
    }
619118
public void setConfiguration(Configuration configuration) {

        this.configuration = configuration;

        // init ParamReaders with the new <Configuration>
        ParamReaders.getInstance().setConfiguration(configuration);

        // register as listener to configuration change
        FoundationConfigurationListenerRegistry.addFoundationConfigurationListener(this);

        // verify that all configured values are correct
        verifyConfiguration();

    }
565494
protected function include_configuration() {
        $configuration = array();
        // We need to allow for late static bindings to allow for class path mudling happending for unit tests.
        $cachefile = static::get_config_file_path();

        if (!file_exists($cachefile)) {
            throw new cache_exception('Default cache config could not be found. It should have already been created by now.');
        }

        if (!include($cachefile)) {
            throw new cache_exception('Unable to load the cache configuration file');
        }

        if (!is_array($configuration)) {
            throw new cache_exception('Invalid cache configuration file');
        }
        if (!array_key_exists('stores', $configuration) || !is_array($configuration['stores'])) {
            $configuration['stores'] = array();
        }
        if (!array_key_exists('modemappings', $configuration) || !is_array($configuration['modemappings'])) {
            $configuration['modemappings'] = array();
        }
        if (!array_key_exists('definitions', $configuration) || !is_array($configuration['definitions'])) {
            $configuration['definitions'] = array();
        }
        if (!array_key_exists('definitionmappings', $configuration) || !is_array($configuration['definitionmappings'])) {
            $configuration['definitionmappings'] = array();
        }
        if (!array_key_exists('locks', $configuration) || !is_array($configuration['locks'])) {
            $configuration['locks'] = array();
        }

        return $configuration;
    }
415715
@Override
    public void applyConfiguration(@NonNull Configuration configuration) {
        if (!wasInitialised.get()) {
            globalLock.writeLock().lock();

            this.configuration = configuration;

            globalLock.writeLock().unlock();
        }
    }
1351065
@SuppressWarnings("unchecked")
  private void mergeConfigs(Map<String, Map<String, ?>> configurationMap,
      Object parsed) {
    if(parsed instanceof Map) {
      Map<?, ?> parsedMap = (Map<?, ?>) parsed;
      for(Object key : parsedMap.keySet()) {
        if(key instanceof String) {
          Map<String, Object> existingValue = (Map<String, Object>) configurationMap.get((String) key);
          if(!configurationMap.containsKey((String) key)) {
            existingValue = new HashMap<String, Object>();
            configurationMap.put((String) key, existingValue);
          }
          Object parsedValue = parsedMap.get(key);
          if(parsedValue instanceof Map) {
            Map<?, ?> parsedValueMap = (Map<?, ?>) parsedValue;
            for(Object parsedKey : parsedValueMap.keySet()) {
              if(parsedKey instanceof String) {
                existingValue.put((String) parsedKey, parsedValueMap.get(parsedKey));
              }
            }
          }
        }
      }
    }
  }
178646
private void addDependencies(Configuration conf) throws IOException {
    TimingEvent distributedCacheSetupTimer =
        this.eventSubmitter.getTimingEvent(TimingEvent.RunJobTimings.MR_DISTRIBUTED_CACHE_SETUP);

    Path jarFileDir = this.jarsDir;

    // Add framework jars to the classpath for the mappers/reducer
    if (this.jobProps.containsKey(ConfigurationKeys.FRAMEWORK_JAR_FILES_KEY)) {
      addJars(jarFileDir, this.jobProps.getProperty(ConfigurationKeys.FRAMEWORK_JAR_FILES_KEY), conf);
    }

    // Add job-specific jars to the classpath for the mappers
    if (this.jobProps.containsKey(ConfigurationKeys.JOB_JAR_FILES_KEY)) {
      addJars(jarFileDir, this.jobProps.getProperty(ConfigurationKeys.JOB_JAR_FILES_KEY), conf);
    }

    // Add other files (if any) the job depends on to DistributedCache
    if (this.jobProps.containsKey(ConfigurationKeys.JOB_LOCAL_FILES_KEY)) {
      addLocalFiles(new Path(this.mrJobDir, FILES_DIR_NAME),
          this.jobProps.getProperty(ConfigurationKeys.JOB_LOCAL_FILES_KEY), conf);
    }

    // Add files (if any) already on HDFS that the job depends on to DistributedCache
    if (this.jobProps.containsKey(ConfigurationKeys.JOB_HDFS_FILES_KEY)) {
      addHDFSFiles(this.jobProps.getProperty(ConfigurationKeys.JOB_HDFS_FILES_KEY), conf);
    }

    // Add job-specific jars existing in HDFS to the classpath for the mappers
    if (this.jobProps.containsKey(ConfigurationKeys.JOB_JAR_HDFS_FILES_KEY)) {
      addHdfsJars(this.jobProps.getProperty(ConfigurationKeys.JOB_JAR_HDFS_FILES_KEY), conf);
    }

    distributedCacheSetupTimer.stop();
  }
1072039
@Override
	public void configure(Configuration config) {
		super.configure(config);

		if (configured) {
			return;
		}
		
		final String fieldDelimStr = config.getString(FIELD_DELIMITER_PARAMETER, null);
		if (fieldDelimStr != null) {
			if (fieldDelimStr.length() != 1) {
				throw new IllegalArgumentException("Invalid configuration for CsvInputFormat: " +
						"Field delimiter must be a single character");
			} else {
				setFieldDelimiter(fieldDelimStr.charAt(0));
			}
		}
		
		// read number of field configured via configuration
		int numConfigFields = config.getInteger(NUM_FIELDS_PARAMETER, -1);
		if (numConfigFields != -1) {
			if (numConfigFields <= 0) {
				throw new IllegalConfigurationException("The number of fields for the CsvInputFormat is invalid.");
			}
			
			if (getNumberOfNonNullFields() > 0) {
				throw new IllegalConfigurationException("Mixing configuration via instance parameters and config parameters is not possible.");
			}
		
			int[] textPosIdx = new int[numConfigFields];
			boolean anyTextPosSet = false;
			boolean allTextPosSet = true;
			int maxTextPos = -1;
			
			// parse text positions
			for (int i = 0; i < numConfigFields; i++) {
				int pos = config.getInteger(TEXT_POSITION_PARAMETER_PREFIX + i, -1);
				if (pos == -1) {
					allTextPosSet = false;
					textPosIdx[i] = i;
					maxTextPos = i;
				} else {
					anyTextPosSet = true;
					textPosIdx[i] = pos;
					maxTextPos = pos > maxTextPos ? pos : maxTextPos;
				}
			}
			// check if either none or all text positions have been set
			if (anyTextPosSet && !allTextPosSet) {
				throw new IllegalArgumentException("Invalid configuration for CsvInputFormat: " +
						"Not all text positions set");
			}
			
			// init the array of types to be set. unify the types from the config 
			// with the types array set on the instance
			
			// make sure we have a sufficiently large types array
			@SuppressWarnings("unchecked")
			Class<? extends Value>[] types = (Class<? extends Value>[]) new Class[maxTextPos+1];
			int[] targetPos = new int[maxTextPos+1];
			
			// set the fields
			for (int i = 0; i < numConfigFields; i++) {
				int pos = textPosIdx[i];
				
				Class<? extends Value> clazz = config.getClass(FIELD_TYPE_PARAMETER_PREFIX + i, null).asSubclass(Value.class);
				if (clazz == null) {
					throw new IllegalConfigurationException("Invalid configuration for CsvInputFormat: " +
						"No field parser class for parameter " + i);
				}
				
				types[pos] = clazz;
				targetPos[pos] = i;
			}
			
			// update the field types
			setFieldTypes(types);
			
			// make a dense target pos array
			this.targetPositions = new int[numConfigFields];
			for (int i = 0, k = 0; i < targetPos.length; i++) {
				if (types[i] != null) {
					this.targetPositions[k++] = targetPos[i];
				}
			}
		}
		else {
			// not configured via config parameters
			if (this.targetPositions.length == 0) {
				this.targetPositions = new int[getNumberOfNonNullFields()];
				for (int i = 0; i < this.targetPositions.length; i++) {
					this.targetPositions[i] = i;
				}
			}
		}
		
		if (getNumberOfNonNullFields() == 0) {
			throw new IllegalConfigurationException("No fields configured in the CsvInputFormat.");
		}

		this.configured = true;
	}
395813
function Config(conf){
  try{
    if(typeof conf === 'string'){
      this.confPath = conf;
      conf = ini.parse(fs.readFileSync(conf, 'utf8'));
    }
  }catch(e){
    conf = {}
  }
  this.conf= conf || {};
}
1064597
public void setConfigurations(java.util.Collection<Configuration> configurations) {
        if (configurations == null) {
            this.configurations = null;
            return;
        }

        this.configurations = new java.util.ArrayList<Configuration>(configurations);
    }
1004332
private synchronized void configure(Configuration config) throws IOException {
    logger.atFine().log("GHFS.configure");
    logger.atFine().log("GHFS_ID = %s", GHFS_ID);

    overrideConfigFromFile(config);
    copyDeprecatedConfigurationOptions(config);
    // Set this configuration as the default config for this instance.
    setConf(config);

    enableFlatGlob = GCS_FLAT_GLOB_ENABLE.get(config, config::getBoolean);
    enableConcurrentGlob = GCS_CONCURRENT_GLOB_ENABLE.get(config, config::getBoolean);
    checksumType = GCS_FILE_CHECKSUM_TYPE.get(config, config::getEnum);
    defaultBlockSize = BLOCK_SIZE.get(config, config::getLong);
    reportedPermissions = new FsPermission(PERMISSIONS_TO_REPORT.get(config, config::get));

    if (gcsFsSupplier == null) {
      if (GCS_LAZY_INITIALIZATION_ENABLE.get(config, config::getBoolean)) {
        gcsFsSupplier =
            Suppliers.memoize(
                () -> {
                  try {
                    GoogleCloudStorageFileSystem gcsFs = createGcsFs(config);

                    pathCodec = gcsFs.getPathCodec();
                    configureBuckets(gcsFs);
                    configureWorkingDirectory(config);
                    gcsFsInitialized = true;

                    return gcsFs;
                  } catch (IOException e) {
                    throw new RuntimeException("Failed to create GCS FS", e);
                  }
                });
        pathCodec = getPathCodec(config);
      } else {
        setGcsFs(createGcsFs(config));
        configureBuckets(getGcsFs());
        configureWorkingDirectory(config);
      }
    } else {
      configureBuckets(getGcsFs());
      configureWorkingDirectory(config);
    }

    logger.atFine().log("GHFS.configure: done");
  }
45037
@Override
    public void configFields(Configuration conf, String[] fields) throws IOException {
        if (null != fields) {
            super.configFields(conf, fields);
            for (int i = 0; i < fields.length; i++) {
                if(fields[i].trim().equals("")) continue;
                if (!XML11Char.isXML11ValidName(fields[i])) {
                    fields[i] = XMLUtil.getValidName(fields[i]);
                }
            }
        } else {
            throw new IOException("Fields not defined");
        }
    }
31629
public static void setInputColumns(Configuration conf, String columns)
    {
        if (columns == null || columns.isEmpty())
            return;
        
        conf.set(INPUT_CQL_COLUMNS_CONFIG, columns);
    }
505140
public void put(VarConfig other) { 
        this.config.putAll(other.config);
        this.vars.addAll(other.vars);
    }
33857
@JsonAnySetter
    public void putConfigurationValue(String key, Object value) {
        this.configuration.put(key, value);
    }