List of usage examples for org.apache.hadoop.conf Configuration set
public void set(String name, String value)
value
of the name
property. From source file:alluxio.hadoop.FileSystemIntegrationTest.java
License:Apache License
@BeforeClass public static void beforeClass() throws Exception { Configuration conf = new Configuration(); conf.set("fs.alluxio.impl", FileSystem.class.getName()); URI uri = URI.create(sLocalAlluxioClusterResource.get().getMasterURI()); sTFS = org.apache.hadoop.fs.FileSystem.get(uri, conf); }
From source file:alluxio.hadoop.FileSystemStatisticsTest.java
License:Apache License
@BeforeClass public static void beforeClass() throws Exception { Configuration conf = new Configuration(); conf.set("fs.alluxio.impl", FileSystem.class.getName()); alluxio.client.file.FileSystem alluxioFS = sLocalAlluxioClusterResource.get().getClient(); FileSystemTestUtils.createByteFile(alluxioFS, "/testFile-read", WriteType.CACHE_THROUGH, FILE_LEN); URI uri = URI.create(sLocalAlluxioClusterResource.get().getMasterURI()); sTFS = org.apache.hadoop.fs.FileSystem.get(uri, conf); sStatistics = org.apache.hadoop.fs.FileSystem.getStatistics(uri.getScheme(), sTFS.getClass()); }
From source file:alluxio.hadoop.HadoopUtils.java
License:Apache License
/** * Set the System property into Hadoop configuration. * * This method won't override existing property even if it is set as System property. * * @param configuration Hadoop configuration * @param propertyName the property to be set *//*from ww w .ja v a 2 s .c o m*/ private static void setConfigurationFromSystemProperty(Configuration configuration, String propertyName) { String propertyValue = System.getProperty(propertyName); if (propertyValue != null && configuration.get(propertyName) == null) { configuration.set(propertyName, propertyValue); } }
From source file:alluxio.underfs.wasb.WasbUnderFileSystem.java
License:Apache License
/** * Prepares the configuration for this Wasb as an HDFS configuration. * * @param conf the configuration for this UFS * @return the created configuration//w w w .ja va 2s.c om */ public static Configuration createConfiguration(UnderFileSystemConfiguration conf) { Configuration wasbConf = HdfsUnderFileSystem.createConfiguration(conf); for (Map.Entry<String, String> entry : conf.toMap().entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (PropertyKey.Template.UNDERFS_AZURE_ACCOUNT_KEY.matches(key)) { wasbConf.set(key, value); } } wasbConf.set("fs.AbstractFileSystem.wasb.impl", "org.apache.hadoop.fs.azure.Wasb"); wasbConf.set("fs.wasb.impl", "org.apache.hadoop.fs.azure.NativeAzureFileSystem"); return wasbConf; }
From source file:andromache.config.CassandraConfigHelper.java
License:Apache License
public static void setOutputKeyspacePassword(Configuration conf, String password) { conf.set(OUTPUT_KEYSPACE_PASSWD_CONFIG, password); }
From source file:andromache.config.CassandraConfigHelper.java
License:Apache License
/** * Set the KeyRange to limit the rows.//from w w w .ja v a2 s . co m * @param conf Job configuration you are about to run */ public static void setInputRange(Configuration conf, String startToken, String endToken, List<IndexExpression> filter) { KeyRange range = new KeyRange().setStart_token(startToken).setEnd_token(endToken).setRow_filter(filter); conf.set(INPUT_KEYRANGE_CONFIG, thriftToString(range)); }
From source file:andromache.config.CassandraConfigHelper.java
License:Apache License
/** * Set the predicate that determines what columns will be selected from each row. * * @param conf Job configuration you are about to run * @param predicate/*w w w.jav a 2s. c o m*/ */ public static void setInputSlicePredicate(Configuration conf, SlicePredicate predicate) { conf.set(INPUT_PREDICATE_CONFIG, thriftToString(predicate)); }
From source file:andromache.config.CassandraConfigHelper.java
License:Apache License
public static void setOutputCompressionChunkLength(Configuration conf, String length) { conf.set(OUTPUT_COMPRESSION_CHUNK_LENGTH, length); }
From source file:andromache.config.CassandraConfigHelper.java
License:Apache License
/** * Set the KeyRange to limit the rows./*from ww w . ja v a 2s . c o m*/ * @param conf Job configuration you are about to run */ public static void setInputRange(Configuration conf, List<IndexExpression> filter) { KeyRange range = new KeyRange().setRow_filter(filter); conf.set(INPUT_KEYRANGE_CONFIG, thriftToString(range)); }
From source file:andromache.config.CassandraConfigHelper.java
License:Apache License
public static void setOutputRpcPort(Configuration conf, String port) { conf.set(OUTPUT_THRIFT_PORT, port); }