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:com.bah.culvert.data.index.Index.java
License:Apache License
/** * Set the column qualifier of the column tuple that is being indexed. * @param colQual The column qualifier.//from w w w. j av a 2 s . c o m * @param conf The configuration to set. */ public static void setColumnQualifier(String colQual, Configuration conf) { conf.set(COL_QUAL_CONF_KEY, colQual); }
From source file:com.bah.culvert.data.index.Index.java
License:Apache License
/** * Used to set a key indicating if the string value held by another * configuration key is a base64 encoded binary or not. * @param isValueBinaryEncodedSetting The key telling weather or not the other * key (setting) is base64.//w w w. j av a2s.c o m * @param potentiallyEncodedSetting The actual key that might be base64 * encoded. * @param data The data to set as base64. * @param conf The configuration to do the setting on. */ private static void setBinaryConfSetting(String isValueBinaryEncodedSetting, String potentiallyEncodedSetting, byte[] data, Configuration conf) { CharsetDecoder decoder = UTF_8.newDecoder(); decoder.onMalformedInput(CodingErrorAction.REPORT); try { CharBuffer colFamString = decoder.decode(ByteBuffer.wrap(data)); conf.setBoolean(isValueBinaryEncodedSetting, false); conf.set(potentiallyEncodedSetting, colFamString.toString()); } catch (CharacterCodingException e) { conf.setBoolean(isValueBinaryEncodedSetting, true); conf.set(potentiallyEncodedSetting, new String(Base64.encodeBase64(data), UTF_8)); } }
From source file:com.bah.culvert.data.index.Index.java
License:Apache License
public static void setDatabaseAdapater(DatabaseAdapter database, Configuration conf) { conf.set(Index.DATABASE_ADAPTER_CONF_KEY, database.getClass().getName()); }
From source file:com.bah.culvert.data.index.TermBasedIndex.java
License:Apache License
/** * Sets the regex used to split the value into tokens. The regex will only be * used if the configuration allows for splitting ( * {@link #setSplitable(boolean, Configuration)}). * <p>/*from w w w. j av a2 s .c om*/ * If no value is set, then the index will use the default regex ( * {@link #DEFAULT_TOKEN_REGEX}). * * @param regex Regex to split the value. * @param conf The configuration to set. */ public static void setTokenRegex(String regex, Configuration conf) { conf.set(TOKEN_REGEX_KEY, regex); }
From source file:com.bah.culvert.hive.CulvertHiveUtils.java
License:Apache License
/** * Set the culvert mapping string on a configuration object. See * {@link #getIndexMappings(Configuration)} for the format. * //from w w w. j a v a 2 s. c om * @param conf The configuration to set the mapping in. * @param mapping The mapping string. */ public static void setCulvertMapping(Configuration conf, String mapping) { conf.set(CULVERT_HIVE_MAPPING_CONF_KEY, mapping); }
From source file:com.bah.culvert.hive.CulvertHiveUtils.java
License:Apache License
/** * Turn a properties object into a configuration object. * // www. j a v a 2 s . c om * @param props The properties to transform. * @return A new configuration populated with the properties settings. */ public static Configuration propsToConf(Properties props) { Configuration conf = new Configuration(false); for (Entry<Object, Object> entry : props.entrySet()) { conf.set(entry.getKey().toString(), entry.getValue().toString()); } return conf; }
From source file:com.bah.culvert.hive.CulvertHiveUtils.java
License:Apache License
/** * Set the culvert table to use as input. * /* w w w.j av a2s . co m*/ * @param conf The configuration to set the table name on. * @return The culvert table name. */ public static void setCulvertTable(Configuration conf, String table) { conf.set(CULVERT_HIVE_CTABLE_NAME_CONF_KEY, table); }
From source file:com.bah.culvert.util.ConfUtils.java
License:Apache License
/** * Pack a configuration into a namespace in another one. * /*from www .ja v a 2 s . c o m*/ * @param prefix The prefix to pack into. A '.' character is appended to the * prefix. * @param toPack The configuration to pack. * @param toPackInto The configuration to pack <tt>toPack</tt> into. * @return <tt>toPackInto</tt>, with <tt>toPack</tt> packed in the prefix. */ public static Configuration packConfigurationInPrefix(String prefix, Configuration toPack, Configuration toPackInto) { for (Entry<String, String> entry : toPack) { toPackInto.set(prefix + "." + entry.getKey(), entry.getValue()); } return toPackInto; }
From source file:com.bah.culvert.util.ConfUtils.java
License:Apache License
/** * Unpack a configuration that has been prefixed. A '.' character must be used * to separate the prefixed keys from the prefix. * //from w w w. j a v a 2 s . c om * @param prefix The prefix to unpack. * @param toUnpackFrom The configuration to unpack from. * @return The unpacked configuration. */ public static Configuration unpackConfigurationInPrefix(String prefix, Configuration toUnpackFrom) { Configuration conf = new Configuration(false); conf.clear(); prefix += "."; for (Entry<String, String> entry : toUnpackFrom) { String key = entry.getKey(); if (key.startsWith(prefix)) { key = key.substring(prefix.length()); conf.set(key, entry.getValue()); } } return conf; }
From source file:com.bah.culvert.utils.HbaseTestProperties.java
License:Apache License
public static void addStandardHBaseProperties(Configuration conf) { // The following properties are from HBase's // src/test/resources/hbase-site.xml conf.set("hbase.regionserver.msginterval", "1000"); conf.set("hbase.client.pause", "5000"); conf.set("hbase.client.retries.number", "4"); conf.set("hbase.master.meta.thread.rescanfrequency", "10000"); conf.set("hbase.server.thread.wakefrequency", "1000"); conf.set("hbase.regionserver.handler.count", "5"); conf.set("hbase.master.info.port", "-1"); conf.set("hbase.regionserver.info.port", "-1"); conf.set("hbase.regionserver.info.port.auto", "true"); conf.set("hbase.master.lease.thread.wakefrequency", "3000"); conf.set("hbase.regionserver.optionalcacheflushinterval", "1000"); conf.set("hbase.regionserver.safemode", "false"); }