List of usage examples for org.apache.commons.configuration Configuration setProperty
void setProperty(String key, Object value);
From source file:eu.cognitum.readandwrite.App.java
public static SailRepository createTitanConnection(String ip, String keyspace) throws RepositoryException { // note: delete Titan Cassandra's keyspace manually String backend = "cassandra"; Configuration conf = new BaseConfiguration(); conf.setProperty("storage.backend", backend); conf.setProperty("storage.hostname", ip); conf.setProperty("storage.keyspace", keyspace); conf.setProperty("cache.db-cache", "true"); TitanGraph g = TitanFactory.open(conf); String indexedPatterns = "p,c,pc"; if (null == g.getType(GraphSail.INFERRED)) { g.makeKey(GraphSail.INFERRED).dataType(Boolean.class); }//from w ww . ja v a 2 s . c om if (null == g.getType(GraphSail.KIND)) { g.makeKey(GraphSail.KIND).dataType(String.class); } if (null == g.getType(GraphSail.LANG)) { g.makeKey(GraphSail.LANG).dataType(String.class); } if (null == g.getType(GraphSail.TYPE)) { g.makeKey(GraphSail.TYPE).dataType(String.class); } if (null == g.getType(GraphSail.VALUE)) { g.makeKey(GraphSail.VALUE).dataType(String.class).unique(); } for (String pattern : indexedPatterns.split(",")) { if (null == g.getType(pattern)) { g.makeKey(pattern).dataType(String.class); } } SailRepository sr = new SailRepository(new GraphSail(g, indexedPatterns)); sr.initialize(); return sr; }
From source file:io.servicecomb.config.ConfigUtil.java
private static void setMicroserviceConfigLoader(Configuration config, MicroserviceConfigLoader loader) { config.setProperty(MICROSERVICE_CONFIG_LOADER_KEY, loader); }
From source file:com.rapid7.diskstorage.dynamodb.TestGraphUtil.java
public static void configureStore(String dataModelName, final int tps, final Configuration storeNs, boolean unlimitedIops) { storeNs.setProperty(Constants.STORES_DATA_MODEL.getName(), dataModelName); storeNs.setProperty(Constants.STORES_SCAN_LIMIT.getName(), 10000); storeNs.setProperty(Constants.STORES_CAPACITY_READ.getName(), tps); storeNs.setProperty(Constants.STORES_READ_RATE_LIMIT.getName(), unlimitedIops ? Integer.MAX_VALUE : tps); storeNs.setProperty(Constants.STORES_CAPACITY_WRITE.getName(), tps); storeNs.setProperty(Constants.STORES_WRITE_RATE_LIMIT.getName(), unlimitedIops ? Integer.MAX_VALUE : tps); }
From source file:com.orientechnologies.orient.server.distributed.OrientdbEdgeTest.java
protected static OrientGraphFactory getGraphFactory() throws Exception { Configuration conf = new BaseConfiguration(); conf.setProperty("storage.url", "remote:localhost/test"); conf.setProperty("storage.pool-min", "1"); conf.setProperty("storage.pool-max", "10"); conf.setProperty("storage.user", "admin"); conf.setProperty("storage.password", "admin"); OGlobalConfiguration.CLIENT_CONNECT_POOL_WAIT_TIMEOUT.setValue(15000); verifyDatabaseExists(conf);//w w w .j a va 2 s .c om return new OrientGraphFactory(conf.getString("storage.url"), conf.getString("storage.user"), conf.getString("storage.password")).setupPool(conf.getInt("storage.pool-min"), conf.getInt("storage.pool-max")); }
From source file:com.rapid7.diskstorage.dynamodb.TestGraphUtil.java
public static Configuration addElasticSearchConfig(Configuration config) { File tempSearchIndexDirectory; try {//w w w . j a va2 s .c o m tempSearchIndexDirectory = Files.createTempDirectory(null /*prefix*/).toFile(); } catch (IOException e) { throw new IllegalStateException("unable to create search index temp dir", e); } final Configuration search = config.subset("index").subset("search"); search.setProperty("backend", "elasticsearch"); search.setProperty("directory", tempSearchIndexDirectory.getAbsolutePath()); final Configuration es = search.subset("elasticsearch"); es.setProperty("client-only", "false"); es.setProperty("local-mode", "true"); return config; }
From source file:com.syncleus.grail.graph.titangraph.TitanGods.java
public static TitanGraph create(final String directory) { BaseConfiguration config = new BaseConfiguration(); Configuration storage = config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE); // configuring local backend storage.setProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, "local"); storage.setProperty(GraphDatabaseConfiguration.STORAGE_DIRECTORY_KEY, directory); // configuring elastic search index Configuration index = storage.subset(GraphDatabaseConfiguration.INDEX_NAMESPACE).subset(INDEX_NAME); index.setProperty(INDEX_BACKEND_KEY, "elasticsearch"); index.setProperty("local-mode", true); index.setProperty("client-only", false); index.setProperty(STORAGE_DIRECTORY_KEY, directory + File.separator + "es"); TitanGraph graph = TitanFactory.open(config); if (!graph.getVertices().iterator().hasNext()) TitanGods.load(graph);// w w w.jav a2 s . c o m return graph; }
From source file:com.linkedin.pinot.broker.broker.helix.DefaultHelixBrokerConfig.java
public static Configuration getDefaultBrokerConf(Configuration externalConfigs) { final Configuration defaultConfigs = getDefaultBrokerConf(); @SuppressWarnings("unchecked") Iterator<String> iterable = externalConfigs.getKeys(); while (iterable.hasNext()) { String key = iterable.next(); defaultConfigs.setProperty(key, externalConfigs.getProperty(key)); }// w w w.j a va 2s. c om return defaultConfigs; }
From source file:com.netflix.loadbalancer.SubsetFilterTest.java
@BeforeClass public static void init() { Configuration config = ConfigurationManager.getConfigInstance(); config.setProperty(DefaultClientConfigImpl.DEFAULT_PROPERTY_NAME_SPACE + ".ServerListSubsetFilter.forceEliminatePercent", "0.6"); config.setProperty(DefaultClientConfigImpl.DEFAULT_PROPERTY_NAME_SPACE + ".ServerListSubsetFilter.eliminationFailureThresold", 2); config.setProperty(DefaultClientConfigImpl.DEFAULT_PROPERTY_NAME_SPACE + ".ServerListSubsetFilter.eliminationConnectionThresold", 2); config.setProperty(DefaultClientConfigImpl.DEFAULT_PROPERTY_NAME_SPACE + ".ServerListSubsetFilter.size", "5"); config.setProperty("SubsetFilerTest.ribbon.NFLoadBalancerClassName", com.netflix.loadbalancer.DynamicServerListLoadBalancer.class.getName()); config.setProperty("SubsetFilerTest.ribbon.NIWSServerListClassName", MockServerList.class.getName()); config.setProperty("SubsetFilerTest.ribbon.NIWSServerListFilterClassName", ServerListSubsetFilter.class.getName()); // turn off auto refresh config.setProperty("SubsetFilerTest.ribbon.ServerListRefreshInterval", String.valueOf(Integer.MAX_VALUE)); config.setProperty("SubsetFilerTest.ribbon.ServerListSubsetFilter.forceEliminatePercent", "0.6"); config.setProperty("SubsetFilerTest.ribbon.ServerListSubsetFilter.eliminationFailureThresold", 2); config.setProperty("SubsetFilerTest.ribbon.ServerListSubsetFilter.eliminationConnectionThresold", 2); config.setProperty("SubsetFilerTest.ribbon.ServerListSubsetFilter.size", "5"); }
From source file:com.linkedin.pinot.server.starter.helix.DefaultHelixStarterServerConfig.java
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)); }/*from w ww. j a va2s. co m*/ return new ServerConf(defaultConfigs); }
From source file:com.splout.db.engine.BaseTest.java
public static Configuration getBaseConfiguration() { Configuration conf = new PropertiesConfiguration(); if (System.getenv("REDIS_HOME") == null) { throw new RuntimeException("REDIS_HOME must be defined to run splout-redis unit tests"); }//from w w w. j av a 2s. co m String redisServerPath = System.getenv("REDIS_HOME") + "/src/redis-server"; conf.setProperty(RedisManager.REDIS_EXECUTABLE_CONF, redisServerPath); return conf; }