@Override public SimpleConfiguration getConnectionConfig() { return new SimpleConfiguration(config); }
public SimpleConfiguration getConfiguration() { if (config == null) { config = new SimpleConfiguration(configMap); } return config; }
public SimpleConfiguration getConfiguration() { if (config == null) { config = new SimpleConfiguration(configMap); } return config; }
public SimpleConfiguration getExporterConfiguration() { if (exporterConfig == null) { return new SimpleConfiguration(); } return exporterConfig; }
@Override public SimpleConfiguration getConnectionConfig() { return new SimpleConfiguration(config); }
public SimpleConfiguration getAppConfiguration() { // TODO create immutable wrapper return new SimpleConfiguration(appConfig); }
public SimpleConfiguration getAppConfiguration() { // TODO create immutable wrapper return new SimpleConfiguration(appConfig); }
/** * Returns a subset of config that start with given prefix. The prefix will not be present in keys * of the returned config. Any changes made to the returned config will be made to this and visa * versa. */ public SimpleConfiguration subset(String prefix) { return new SimpleConfiguration(internalConfig.subset(prefix)); }
/** * Returns configuration with all Fluo properties set to their default. NOTE - some properties do * not have defaults and will not be set. */ public static SimpleConfiguration getDefaultConfiguration() { SimpleConfiguration config = new SimpleConfiguration(); setDefaultConfiguration(config); return config; }
/** * Returns a subset of config that start with given prefix. The prefix will not be present in keys * of the returned config. Any changes made to the returned config will be made to this and visa * versa. */ public SimpleConfiguration subset(String prefix) { return new SimpleConfiguration(internalConfig.subset(prefix)); }
/** * Returns configuration with all Fluo properties set to their default. NOTE - some properties do * not have defaults and will not be set. */ public static SimpleConfiguration getDefaultConfiguration() { SimpleConfiguration config = new SimpleConfiguration(); setDefaultConfiguration(config); return config; }
/** * Returns a SimpleConfiguration clientConfig with properties set from this configuration * * @return SimpleConfiguration */ public SimpleConfiguration getClientConfiguration() { SimpleConfiguration clientConfig = new SimpleConfiguration(); Iterator<String> iter = getKeys(); while (iter.hasNext()) { String key = iter.next(); if (key.startsWith(CONNECTION_PREFIX) || key.startsWith(ACCUMULO_PREFIX) || key.startsWith(CLIENT_PREFIX)) { clientConfig.setProperty(key, getRawString(key)); } } return clientConfig; }
/** * Returns a SimpleConfiguration clientConfig with properties set from this configuration * * @return SimpleConfiguration */ public SimpleConfiguration getClientConfiguration() { SimpleConfiguration clientConfig = new SimpleConfiguration(); Iterator<String> iter = getKeys(); while (iter.hasNext()) { String key = iter.next(); if (key.startsWith(CONNECTION_PREFIX) || key.startsWith(ACCUMULO_PREFIX) || key.startsWith(CLIENT_PREFIX)) { clientConfig.setProperty(key, getRawString(key)); } } return clientConfig; }
/** * @param fallback SimpleConfiguration to join together * @return a new simple configuration that contains all of the current properties from this plus * the properties from fallback that are not present in this. * * @since 1.2.0 */ public SimpleConfiguration orElse(SimpleConfiguration fallback) { SimpleConfiguration copy = new SimpleConfiguration(this); for (Map.Entry<String, String> entry : fallback.toMap().entrySet()) { if (!copy.containsKey(entry.getKey())) { copy.setProperty(entry.getKey(), entry.getValue()); } } return copy; }
/** * @param fallback SimpleConfiguration to join together * @return a new simple configuration that contains all of the current properties from this plus * the properties from fallback that are not present in this. * * @since 1.2.0 */ public SimpleConfiguration orElse(SimpleConfiguration fallback) { SimpleConfiguration copy = new SimpleConfiguration(this); for (Map.Entry<String, String> entry : fallback.toMap().entrySet()) { if (!copy.containsKey(entry.getKey())) { copy.setProperty(entry.getKey(), entry.getValue()); } } return copy; }
public static SimpleConfiguration getZookeeperConfig(FluoConfiguration config) { if (!isInitialized(config)) { throw new IllegalStateException( "Fluo Application '" + config.getApplicationName() + "' has not been initialized"); } SimpleConfiguration zooConfig = new SimpleConfiguration(); try (CuratorFramework curator = CuratorUtil.newAppCurator(config)) { curator.start(); try (ByteArrayInputStream bais = new ByteArrayInputStream(curator.getData().forPath(ZookeeperPath.CONFIG_SHARED))) { Properties sharedProps = new Properties(); sharedProps.load(bais); for (String prop : sharedProps.stringPropertyNames()) { zooConfig.setProperty(prop, sharedProps.getProperty(prop)); } } } catch (Exception e) { throw new IllegalStateException(e); } return zooConfig; }
public static SimpleConfiguration getZookeeperConfig(FluoConfiguration config) { if (!isInitialized(config)) { throw new IllegalStateException( "Fluo Application '" + config.getApplicationName() + "' has not been initialized"); } SimpleConfiguration zooConfig = new SimpleConfiguration(); try (CuratorFramework curator = CuratorUtil.newAppCurator(config)) { curator.start(); ByteArrayInputStream bais = new ByteArrayInputStream(curator.getData().forPath(ZookeeperPath.CONFIG_SHARED)); Properties sharedProps = new Properties(); sharedProps.load(bais); for (String prop : sharedProps.stringPropertyNames()) { zooConfig.setProperty(prop, sharedProps.getProperty(prop)); } } catch (Exception e) { throw new IllegalStateException(e); } return zooConfig; }