while (keys.hasNext()) { String key = keys.next(); confMap.put(key, config.getProperty(key));
public boolean getIndexableGraphDisabled() { Object bool = conf.getProperty(Keys.DISABLE_INDEX); if (bool == null) return false; return (Boolean) bool; }
public boolean getAutoIndex() { Object bool = conf.getProperty(Keys.AUTO_INDEX); if (bool == null) return false; return (Boolean) bool; }
public boolean getAutoIndex() { Object bool = conf.getProperty(Keys.AUTO_INDEX); if (bool == null) return false; return (Boolean) bool; }
public boolean getIndexableGraphDisabled() { Object bool = conf.getProperty(Keys.DISABLE_INDEX); if (bool == null) return false; return (Boolean) bool; }
@Override public synchronized Object get( Object key ) { if ( key == null || key instanceof String ) { return propertiesConfiguration.getProperty( (String) key ); } else { return null; } }
private int getLongRetryDelay(Connector connector) { String key = connector.getName() + ".longRetryDelay"; if (env.connectors.containsKey(key)) { return Integer.valueOf((String)env.connectors.getProperty(key)); } else { return Integer.valueOf((String)env.connectors.getProperty("longRetryDelay")); } }
private String getDeviceNickname(String connectorAndObjectType) { Iterator<String> keys = env.bodytrackProperties.getKeys(); while (keys.hasNext()) { String key = keys.next(); if (key.startsWith(connectorAndObjectType)) { if (key.endsWith("dev_nickname")) return (String) env.bodytrackProperties.getProperty(key); } } return null; }
@Override public String toString() { StringBuilder propertyValues = new StringBuilder(); for (Iterator<?> it = propertiesConfiguration.getKeys(); it.hasNext();) { String key = (String) it.next(); Object value = propertiesConfiguration.getProperty(key); propertyValues.append("key=" + key + " value=" + value.toString()); } return propertyValues.toString(); }
@SuppressWarnings("unchecked") public <T> Map<String, T> getAllProperties() throws ConfigurationException { Map<String, T> map = new HashMap<String, T>(); for (Iterator<?> it = propertiesConfiguration.getKeys(); it.hasNext();) { String key = (String) it.next(); if (!map.containsKey(key)) { map.put(key, (T) propertiesConfiguration.getProperty(key)); } } return map; }
private Map<String, Object> toMap() { Map<String, Object> result = new HashMap<>(); Iterator<String> keys = propertiesConfiguration.getKeys(); while ( keys.hasNext() ) { String next = keys.next(); result.put( next, propertiesConfiguration.getProperty( next ) ); } return result; }
public org.apache.hadoop.conf.Configuration toHBaseConfiguration() { org.apache.hadoop.conf.Configuration c = new org.apache.hadoop.conf.Configuration(); conf.getKeys().forEachRemaining(key -> c.set(key, conf.getProperty(key).toString())); return c; }
private int getShortRetryDelay(Connector connector) { String key = connector.getName() + ".shortRetryDelay"; if (env.connectors.containsKey(key)) { return Integer.valueOf((String)env.connectors.getProperty(key)); } else { return Integer.valueOf((String)env.connectors.getProperty("shortRetryDelay")); } }
@Override public synchronized Object remove( Object key ) { if ( key == null || key instanceof String ) { Object result = propertiesConfiguration.getProperty( (String) key ); propertiesConfiguration.clearProperty( (String) key ); return result; } return null; }
private int getMaxRetries(Connector connector) { String key = connector.getName() + ".maxRetries"; if (env.connectors.containsKey(key)) { return Integer.valueOf((String)env.connectors.getProperty(key)); } else { return Integer.valueOf((String)env.connectors.getProperty("maxRetries")); } }
private String getAsString(PropertiesConfiguration properties, String key) { if (properties==null) return null; final Object property = properties.getProperty(key); if (property==null) return null; if (!(property instanceof String)) { final String message = "Property " + key + " was supposed to be a String, found " + property.getClass(); logger.error(message); System.out.println(message); return ""; } return (String) property; }
/** * Print out this configuration. */ public void print() { System.out.println(AccumuloGraphConfiguration.class+":"); for (String key : getValidInternalKeys()) { String value = "(null)"; if (conf.containsKey(key)) { value = conf.getProperty(key).toString(); } System.out.println(" "+key+" = "+value); } }
private void processClassificationFile(String file) { try { PropertiesConfiguration config = new PropertiesConfiguration(file); Iterator<String> keys = config.getKeys(); while (keys.hasNext()) { String key = keys.next(); String value = config.getProperty(key).toString(); this.configuration.addClassifications(key, value); } } catch (ConfigurationException e) { throw new ValidationException(String.format("File '%s' doesn't exist or the properties file is invalid!", file), e); } }
/** * Get a string associated with the given property key * * @param key * The property key. * @return The associated string. */ @Deprecated public static String getString(final String key) { // beware of List problems, so get the object and convert it to a string return asString(getConfiguration().getProperty(key)); }
@SuppressWarnings("unchecked") public <T> T getProperty(String key) { Validation.isNullOrEmptyParameter("key", key); if (propertiesConfiguration != null) { T value = (T) propertiesConfiguration.getProperty(key); return value; } throw new MissingPropertyException("Cannot locate property with key=" + key); } }