Specify a custom {@code Configuration} that will be used when creating
the {@link FileSystem} for writing.
429795
public BucketingSink<T> setFSConfig(org.apache.hadoop.conf.Configuration config) {
		this.fsConfig = new Configuration();
		for (Map.Entry<String, String> entry : config) {
			fsConfig.setString(entry.getKey(), entry.getValue());
		}
		return this;
	}
362393
@Override
  protected void configure() {

    // Bind and expose LogWriter (a bit hacky, but needed by MapReduce for now)
    bind(LogWriter.class).to(LocalLogWriter.class);
    expose(LogWriter.class);

    // Bind ServiceAnnouncer for procedure.
    bind(ServiceAnnouncer.class).to(DiscoveryServiceAnnouncer.class);

    // For Binding queue stuff
    bind(QueueReaderFactory.class).in(Scopes.SINGLETON);

    // Bind ProgramRunner
    MapBinder<ProgramRunnerFactory.Type, ProgramRunner> runnerFactoryBinder =
      MapBinder.newMapBinder(binder(), ProgramRunnerFactory.Type.class, ProgramRunner.class);
    runnerFactoryBinder.addBinding(ProgramRunnerFactory.Type.FLOW).to(FlowProgramRunner.class);
    runnerFactoryBinder.addBinding(ProgramRunnerFactory.Type.FLOWLET).to(FlowletProgramRunner.class);

    bind(ProgramRunnerFactory.class).to(InMemoryFlowProgramRunnerFactory.class).in(Scopes.SINGLETON);
    // Note: Expose for test cases. Need to refactor test cases.
    expose(ProgramRunnerFactory.class);

    // For binding DataSet transaction stuff
    install(new DataFabricFacadeModule());
  }
536501
@Override
    public void write(final Writer writer) throws ConfigurationException, IOException {
        Preconditions.checkNotNull(writer);

        @SuppressWarnings("unchecked") final
        HashMap<String, Object> settings = (HashMap<String, Object>) fromNode(this.getModel().getInMemoryRepresentation());
        this.mapper.writerWithDefaultPrettyPrinter().writeValue(writer, settings);
    }
1064597
public void setConfigurations(java.util.Collection<Configuration> configurations) {
        if (configurations == null) {
            this.configurations = null;
            return;
        }

        this.configurations = new java.util.ArrayList<Configuration>(configurations);
    }
797032
public Configuration createConfiguration()
    {
        if (crackingHardwareCost == null)
        {
            crackingHardwareCost = getDefaultCrackingHardwareCost();
        }
        if (passwordMatchers == null)
        {
            passwordMatchers = getDefaultPasswordMatchers();
        }
        if (guessTypes == null)
        {
            guessTypes = getDefaultGuessTypes(crackingHardwareCost);
        }
        if (dictionaries == null)
        {
            dictionaries = getDefaultDictionaries();
        }
        if (adjacencyGraphs == null)
        {
            adjacencyGraphs = getDefaultAdjacencyGraphs();
        }
        if (leetTable == null)
        {
            leetTable = getDefaultLeetTable();
        }
        if (yearPattern == null)
        {
            yearPattern = getDefaultYearPattern();
        }
        if (minimumEntropy == null)
        {
            minimumEntropy = getDefaultMinimumEntropy();
        }
        if (locale == null)
        {
            locale = Locale.getDefault();
        }
        if (distanceCalc == null)
        {
            distanceCalc = getDefaultDistanceCalc();
        }
        if (combinationAlgorithmTimeout == null)
        {
            combinationAlgorithmTimeout = getDefaultCombinationAlgorithmTimeout();
        }
        return new Configuration(passwordMatchers, guessTypes, dictionaries, adjacencyGraphs, leetTable, yearPattern, minimumEntropy, locale, distanceCalc, combinationAlgorithmTimeout);
    }
108888
public Configuration createConfiguration() throws IOException, TemplateException {
        Configuration config = newConfiguration();
        Properties props = new Properties();

        // Merge local properties if specified.
        if (this.freemarkerSettings != null) {
            props.putAll(this.freemarkerSettings);
        }

        // FreeMarker will only accept known keys in its setSettings and
        // setAllSharedVariables methods.
        if (!props.isEmpty()) {
            config.setSettings(props);
        }

        if (this.freemarkerVariables != null && freemarkerVariables.size() > 0) {
            config.setAllSharedVariables(new SimpleHash(this.freemarkerVariables, config.getObjectWrapper()));
        }

        if (this.defaultEncoding != null) {
            config.setDefaultEncoding(this.defaultEncoding);
        }

        // determine FreeMarker TemplateLoader
        if (templateLoaders == null) {
            if (templateLoaderPaths != null && templateLoaderPaths.length > 0) {
                List<TemplateLoader> templateLoaderList = new ArrayList<>();
                for (String path : templateLoaderPaths) {
                    templateLoaderList.add(getTemplateLoaderForPath(path));
                }
                setTemplateLoader(templateLoaderList);
            }
        }

        TemplateLoader templateLoader = getAggregateTemplateLoader(templateLoaders);
        if (templateLoader != null) {
            config.setTemplateLoader(templateLoader);
        }

        // determine CustomTrimDirectives
        if (trimDirectives != null && trimDirectives.length > 0) {
            TrimDirectiveGroup group = new TrimDirectiveGroup(trimDirectives);
            for (Map.Entry<String, Map<String, TrimDirective>> directives : group.entrySet()) {
                config.setSharedVariable(directives.getKey(), directives.getValue());
            }
        }

        return config;
    }
996998
public static StoreWriter createWriter(OutputStream stream, Configuration config) {
    return StoreImpl.createWriter(stream, config);
  }
213007
public static DocFile createFileForDirectory(Configuration configuration, String file) {
        return DocFileFactory.getFactory(configuration).createFileForDirectory(file);
    }
240790
public Configuration writeConfiguration(final File jobFolder,
                                          final String jobId,
                                          final String clientRemoteId) throws IOException {
    final File driverFolder = new File(jobFolder, PreparedDriverFolderLauncher.DRIVER_FOLDER_NAME);

    final Configuration driverConfiguration1 = driverConfigurationProvider
        .getDriverConfiguration(jobFolder.toURI(), clientRemoteId,
        jobId, Constants.DRIVER_CONFIGURATION_WITH_HTTP_AND_NAMESERVER);
    final ConfigurationBuilder configurationBuilder = Tang.Factory.getTang().newConfigurationBuilder();
    for (final ConfigurationProvider configurationProvider : this.configurationProviders) {
      configurationBuilder.addConfiguration(configurationProvider.getConfiguration());
    }
    final Configuration providedConfigurations = configurationBuilder.build();
    final Configuration driverConfiguration = Configurations.merge(
        driverConfiguration1,
        Tang.Factory.getTang()
          .newConfigurationBuilder()
          .bindNamedParameter(JobSubmissionDirectory.class, driverFolder.toString())
          .build(),
        providedConfigurations);
    final File driverConfigurationFile = new File(driverFolder, fileNames.getDriverConfigurationPath());
    configurationSerializer.toFile(driverConfiguration, driverConfigurationFile);
    return driverConfiguration;
  }
209419
public static void generate(Configuration configuration) {
        PackageListWriter packgen;
        try {
            packgen = new PackageListWriter(configuration);
            packgen.generatePackageListFile(configuration.root);
            packgen.close();
        } catch (IOException exc) {
            configuration.message.error("doclet.exception_encountered",
                exc.toString(), DocPaths.PACKAGE_LIST);
            throw new DocletAbortException(exc);
        }
    }
871238
public void writeConfiguration(final YarnClusterSubmissionFromCS yarnClusterSubmissionFromCS,
                                 final JobFolder jobFolderOnDFS) throws IOException {
    final File yarnAppParametersFile = new File(yarnClusterSubmissionFromCS.getDriverFolder(),
        fileNames.getYarnBootstrapAppParamFilePath());

    final File yarnJobParametersFile = new File(yarnClusterSubmissionFromCS.getDriverFolder(),
        fileNames.getYarnBootstrapJobParamFilePath());

    try (final FileOutputStream appFileOutputStream = new FileOutputStream(yarnAppParametersFile)) {
      try (final FileOutputStream jobFileOutputStream = new FileOutputStream(yarnJobParametersFile)) {
        // this is mainly a test hook.
        writeAvroYarnAppSubmissionParametersToOutputStream(yarnClusterSubmissionFromCS, appFileOutputStream);
        writeAvroYarnJobSubmissionParametersToOutputStream(
            yarnClusterSubmissionFromCS, jobFolderOnDFS.getPath().toString(), jobFileOutputStream);
      }
    }
  }
715397
protected void prepareInternal(Map conf, String overrideBase, Configuration hadoopConf) {
        this.conf = conf;
        if (overrideBase == null) {
            overrideBase = (String)conf.get(Config.BLOBSTORE_DIR);
        }
        if (overrideBase == null) {
            throw new RuntimeException("You must specify a blobstore directory for HDFS to use!");
        }
        LOG.debug("directory is: {}", overrideBase);
//        try {
//            // if a HDFS keytab/principal have been supplied login, otherwise assume they are
//            // logged in already or running insecure HDFS.
//            String principal = (String) conf.get(Config.BLOBSTORE_HDFS_PRINCIPAL);
//            String keyTab = (String) conf.get(Config.BLOBSTORE_HDFS_KEYTAB);
//
//            if (principal != null && keyTab != null) {
//                UserGroupInformation.loginUserFromKeytab(principal, keyTab);
//            } else {
//                if (principal == null && keyTab != null) {
//                    throw new RuntimeException("You must specify an HDFS principal to go with the keytab!");
//
//                } else {
//                    if (principal != null && keyTab == null) {
//                        throw new RuntimeException("You must specify HDFS keytab go with the principal!");
//                    }
//                }
//            }
//        } catch (IOException e) {
//            throw new RuntimeException("Error logging in from keytab!", e);
//        }
        Path baseDir = new Path(overrideBase, BASE_BLOBS_DIR_NAME);
        try {
            if (hadoopConf != null) {
                _hbs = new HdfsBlobStoreImpl(baseDir, conf, hadoopConf);
            } else {
                _hbs = new HdfsBlobStoreImpl(baseDir, conf);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
//        _localSubject = getHadoopUser();
    }
932938
private static Mono<Void> addConfigurations(ConfigurationAsyncClient client, String configurationSet,
                                                String storageEndpoint, ComplexConfiguration complexConfiguration) throws JsonProcessingException {
        ConfigurationSetting endpointSetting = new ConfigurationSetting()
            .key(CONNECTION_STRING_KEY)
            .label(configurationSet)
            .value(storageEndpoint);
        ConfigurationSetting keyVaultSetting = new ConfigurationSetting()
            .key(COMPLEX_SETTING_KEY)
            .label(configurationSet)
            .value(MAPPER.writeValueAsString(complexConfiguration))
            .contentType("application/json");

        return Flux.merge(client.addSetting(keyVaultSetting), client.addSetting(endpointSetting)).then();
    }
1194314
private <K, V> CacheConfiguration<K, V> adjustConfigurationWithCacheManagerDefaults(String alias, CacheConfiguration<K, V> config) {
    ClassLoader cacheClassLoader = config.getClassLoader();

    List<ServiceConfiguration<?>> configurationList = new ArrayList<>();
    configurationList.addAll(config.getServiceConfigurations());

    CacheLoaderWriterConfiguration loaderWriterConfiguration = findSingletonAmongst(CacheLoaderWriterConfiguration.class, config.getServiceConfigurations());
    if (loaderWriterConfiguration == null) {
      CacheLoaderWriterProvider loaderWriterProvider = serviceLocator.getService(CacheLoaderWriterProvider.class);
      ServiceConfiguration<CacheLoaderWriterProvider> preConfiguredCacheLoaderWriterConfig = loaderWriterProvider.getPreConfiguredCacheLoaderWriterConfig(alias);
      if (preConfiguredCacheLoaderWriterConfig != null) {
        configurationList.add(preConfiguredCacheLoaderWriterConfig);
      }
      if (loaderWriterProvider.isLoaderJsrProvided(alias)) {
        configurationList.add(new CacheLoaderWriterConfiguration() {
        });
      }
    }

    ServiceConfiguration<?>[] serviceConfigurations = new ServiceConfiguration<?>[configurationList.size()];
    configurationList.toArray(serviceConfigurations);

    if (cacheClassLoader == null) {
      cacheClassLoader = cacheManagerClassLoader;
    }
    if (cacheClassLoader != config.getClassLoader() ) {
      config = new BaseCacheConfiguration<>(config.getKeyType(), config.getValueType(),
        config.getEvictionAdvisor(), cacheClassLoader, config.getExpiryPolicy(),
        config.getResourcePools(), serviceConfigurations);
    } else {
      config = new BaseCacheConfiguration<>(config.getKeyType(), config.getValueType(),
              config.getEvictionAdvisor(), config.getClassLoader(), config.getExpiryPolicy(),
              config.getResourcePools(), serviceConfigurations);
    }
    return config;
  }
1211197
public static StoreWriter createWriter(File file, Configuration config) {
    return StoreImpl.createWriter(file, config);
  }
470998
public static FileSystem createInstance(
      Configuration config, Path workingDirectory, Collection<FileStatus> fileStatuses) {
    checkNotNull(config, "configuration can not be null");

    FileSystem fileSystem = new InMemoryGlobberFileSystem(workingDirectory, fileStatuses);
    fileSystem.setConf(config);

    return fileSystem;
  }
31856
def custom_conf(self, conf):
        ''''''
        if conf:
            for (key, val) in conf.items():
                self.__conf[key] = val
        return self