private int getMaxThreads(final String prop) { if (this.confFactory != null) { AccumuloConfiguration conf = this.confFactory.getConfiguration(); Map<String,String> properties = new TreeMap<>(); conf.getProperties(properties, new AccumuloConfiguration.MatchFilter(prop)); if (properties.containsKey(prop)) { return Integer.parseInt(properties.get(prop)); } } return DEFAULT_THREAD_POOL_SIZE; }
/** * Gets a property value from this configuration. * * <p> * Note: this is inefficient, but convenient on occasion. For retrieving multiple properties, use * {@link #getProperties(Map, Predicate)} with a custom filter. * * @param property * property to get * @return property value */ public String get(String property) { Map<String,String> propMap = new HashMap<>(1); getProperties(propMap, new MatchFilter(property)); return propMap.get(property); }
private long getLongProperty(final String prop, final long defaultValue) { if (this.myEnv != null && this.myEnv.getConfig() != null) { AccumuloConfiguration conf = this.myEnv.getConfig(); Map<String,String> properties = new TreeMap<>(); conf.getProperties(properties, new AccumuloConfiguration.MatchFilter(prop)); if (properties.containsKey(prop)) { return Long.parseLong(properties.get(prop)); } } return defaultValue; }