@Test public void testFile() { URL propsUrl = getClass().getClassLoader().getResource("accumulo2.properties"); var conf = new SiteConfiguration.Builder().fromUrl(propsUrl).build(); assertEquals("myhost123:2181", conf.get(Property.INSTANCE_ZK_HOST)); assertEquals("mysecret", conf.get(Property.INSTANCE_SECRET)); assertEquals("hdfs: assertEquals("123s", conf.get(Property.GENERAL_RPC_TIMEOUT)); assertEquals("256M", conf.get(Property.TSERV_WALOG_MAX_SIZE)); assertEquals("org.apache.accumulo.core.cryptoImpl.AESCryptoService", conf.get(Property.INSTANCE_CRYPTO_SERVICE)); }
@Override public String get(Property property) { String value = config.get(property.getKey()); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", property.getKey(), property.getType(), value); } value = parent.get(property); } return value; }
SiteConfiguration extends AccumuloConfiguration { @Override public String get(Property property) { String value = config.get(property.getKey()); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", property.getKey(), property.getType(), value); } value = parent.get(property); } return value; } }
SiteConfiguration extends AccumuloConfiguration { @Override public String get(Property property) { String value = config.get(property.getKey()); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", property.getKey(), property.getType(), value); } value = parent.get(property); } return value; } private  SiteConfiguration(Map<String,String> config); }
SiteConfiguration extends AccumuloConfiguration { @Override public String get(Property property) { String value = config.get(property.getKey()); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", property.getKey(), property.getType(), value); } value = parent.get(property); } return value; } private  SiteConfiguration(Map<String,String> config); static SiteConfiguration.OverridesOption fromEnv(); static SiteConfiguration.OverridesOption fromFile(File propertiesFileLocation); static SiteConfiguration auto(); @Override String get(Property property); @Override boolean isPropertySet(Property prop, boolean cacheAndWatch); @Override void getProperties(Map<String,String> props, Predicate<String> filter); void getProperties(Map<String,String> props, Predicate<String> filter,
      boolean useDefaults); }
SiteConfiguration extends AccumuloConfiguration { @Override public String get(Property property) { String value = config.get(property.getKey()); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", property.getKey(), property.getType(), value); } value = parent.get(property); } return value; } private  SiteConfiguration(Map<String,String> config); static SiteConfiguration.OverridesOption fromEnv(); static SiteConfiguration.OverridesOption fromFile(File propertiesFileLocation); static SiteConfiguration auto(); @Override String get(Property property); @Override boolean isPropertySet(Property prop, boolean cacheAndWatch); @Override void getProperties(Map<String,String> props, Predicate<String> filter); void getProperties(Map<String,String> props, Predicate<String> filter,
      boolean useDefaults);  }