use of org.apache.commons.configuration.Configuration in project ribbon by Netflix.
the class ClientPropertiesTest method testNoExportToArchaius.
@Test
public void testNoExportToArchaius() {
MyTransportFactory transportFactory = new MyTransportFactory(ClientConfigFactory.DEFAULT);
RibbonResourceFactory resourceFactory = new DefaultResourceFactory(ClientConfigFactory.DEFAULT, transportFactory);
RibbonDynamicProxy.newInstance(MovieService.class, resourceFactory, ClientConfigFactory.DEFAULT, transportFactory);
IClientConfig clientConfig = transportFactory.getClientConfig();
assertEquals(1000, clientConfig.get(Keys.ConnectTimeout).longValue());
assertEquals(3000, clientConfig.get(Keys.ReadTimeout).longValue());
assertEquals(0, clientConfig.get(Keys.MaxAutoRetriesNextServer).longValue());
Configuration config = ConfigurationManager.getConfigInstance();
assertNull(config.getProperty("MovieService.ribbon.ReadTimeout"));
config.setProperty("MovieService.ribbon.ReadTimeout", "5000");
assertEquals(5000, clientConfig.get(Keys.ReadTimeout).longValue());
}
use of org.apache.commons.configuration.Configuration in project OpenAttestation by OpenAttestation.
the class TDPConfig method getJpaProperties.
public static Properties getJpaProperties() {
Configuration config = getConfiguration();
Properties prop = new Properties();
prop.put("javax.persistence.jdbc.driver", config.getString("mountwilson.tdbp.db.driver", config.getString("mtwilson.db.driver", "com.mysql.jdbc.Driver")));
prop.put("javax.persistence.jdbc.url", config.getString("mountwilson.tdbp.db.url", config.getString("mtwilson.db.url", String.format("jdbc:mysql://%s:%s/%s?autoReconnect=true", config.getString("mountwilson.tdbp.db.host", config.getString("mtwilson.db.host", "127.0.0.1")), config.getString("mountwilson.tdbp.db.port", config.getString("mtwilson.db.port", "3306")), config.getString("mountwilson.tdbp.db.schema", config.getString("mtwilson.db.schema", "mw_as"))))));
prop.put("javax.persistence.jdbc.user", config.getString("mountwilson.tdbp.db.user", config.getString("mtwilson.db.user", "root")));
prop.put("javax.persistence.jdbc.password", config.getString("mountwilson.tdbp.db.password", config.getString("mtwilson.db.password", "password")));
return prop;
}
use of org.apache.commons.configuration.Configuration in project pinot by linkedin.
the class DefaultHelixStarterServerConfig method getDefaultHelixServerConfig.
public static ServerConf getDefaultHelixServerConfig(Configuration externalConfigs) {
Configuration defaultConfigs = loadDefaultServerConf();
@SuppressWarnings("unchecked") Iterator<String> iterable = externalConfigs.getKeys();
while (iterable.hasNext()) {
String key = iterable.next();
defaultConfigs.setProperty(key, externalConfigs.getProperty(key));
LOGGER.info("External config key: {}, value: {}", key, externalConfigs.getProperty(key));
}
return new ServerConf(defaultConfigs);
}
use of org.apache.commons.configuration.Configuration in project pinot by linkedin.
the class PerfBenchmarkDriver method startBroker.
private void startBroker() throws Exception {
if (!_conf.isStartBroker()) {
LOGGER.info("Skipping start broker step. Assumes broker is already started.");
return;
}
Configuration brokerConfiguration = new PropertiesConfiguration();
String brokerInstanceName = "Broker_localhost_" + CommonConstants.Helix.DEFAULT_BROKER_QUERY_PORT;
brokerConfiguration.setProperty("instanceId", brokerInstanceName);
LOGGER.info("Starting broker instance: {}", brokerInstanceName);
new HelixBrokerStarter(_clusterName, _zkAddress, brokerConfiguration);
}
use of org.apache.commons.configuration.Configuration in project pinot by linkedin.
the class SegmentFetcherFactory method initSegmentFetcherFactory.
public static void initSegmentFetcherFactory(Configuration pinotHelixProperties) {
Configuration segmentFetcherFactoryConfig = pinotHelixProperties.subset(CommonConstants.Server.PREFIX_OF_CONFIG_OF_SEGMENT_FETCHER_FACTORY);
Iterator segmentFetcherFactoryConfigIterator = segmentFetcherFactoryConfig.getKeys();
while (segmentFetcherFactoryConfigIterator.hasNext()) {
Object configKeyObject = segmentFetcherFactoryConfigIterator.next();
try {
String segmentFetcherConfigKey = configKeyObject.toString();
String protocol = segmentFetcherConfigKey.split(".", 2)[0];
if (!SegmentFetcherFactory.containsProtocol(protocol)) {
SegmentFetcherFactory.initSegmentFetcher(new ConfigurationMap(segmentFetcherFactoryConfig.subset(protocol)));
}
} catch (Exception e) {
LOGGER.error("Got exception to process the key: " + configKeyObject);
}
}
}
Aggregations