Search in sources :

Example 56 with BaseConfiguration

use of org.apache.commons.configuration.BaseConfiguration in project titan by thinkaurelius.

the class GraphOfTheGodsFactory method create.

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);
    GraphOfTheGodsFactory.load(graph);
    return graph;
}
Also used : TitanGraph(com.thinkaurelius.titan.core.TitanGraph) BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) Configuration(org.apache.commons.configuration.Configuration) GraphDatabaseConfiguration(com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration) BaseConfiguration(org.apache.commons.configuration.BaseConfiguration)

Example 57 with BaseConfiguration

use of org.apache.commons.configuration.BaseConfiguration in project java-chassis by ServiceComb.

the class TestInstancePropertyDiscoveryFilter method beforeCls.

@BeforeClass
public static void beforeCls() {
    AbstractConfiguration configuration = new BaseConfiguration();
    configuration.addProperty("servicecomb.loadbalance.test.flowsplitFilter.policy", "org.apache.servicecomb.loadbalance.filter.SimpleFlowsplitFilter");
    configuration.addProperty("servicecomb.loadbalance.test.flowsplitFilter.options.tag0", "value0");
}
Also used : AbstractConfiguration(org.apache.commons.configuration.AbstractConfiguration) BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) BeforeClass(org.junit.BeforeClass)

Example 58 with BaseConfiguration

use of org.apache.commons.configuration.BaseConfiguration in project titan by thinkaurelius.

the class StorageSetup method getInMemoryGraph.

public static TitanGraph getInMemoryGraph() {
    BaseConfiguration config = new BaseConfiguration();
    config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, "inmemory");
    return TitanFactory.open(config);
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration)

Example 59 with BaseConfiguration

use of org.apache.commons.configuration.BaseConfiguration in project titan by thinkaurelius.

the class ElasticSearchBerkeleyDBTest method getElasticSearchBDBConfig.

public static final Configuration getElasticSearchBDBConfig() {
    BaseConfiguration config = new BaseConfiguration();
    config.subset(STORAGE_NAMESPACE).addProperty(STORAGE_BACKEND_KEY, "com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager");
    config.subset(STORAGE_NAMESPACE).addProperty(STORAGE_DIRECTORY_KEY, StorageSetup.getHomeDir());
    // Add index
    Configuration sub = config.subset(STORAGE_NAMESPACE).subset(INDEX_NAMESPACE).subset(INDEX);
    sub.setProperty(INDEX_BACKEND_KEY, "com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex");
    sub.setProperty(LOCAL_MODE_KEY, true);
    sub.setProperty(CLIENT_ONLY_KEY, false);
    sub.setProperty(STORAGE_DIRECTORY_KEY, StorageSetup.getHomeDir("es"));
    // System.out.println(GraphDatabaseConfiguration.toString(config));
    return config;
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) Configuration(org.apache.commons.configuration.Configuration) GraphDatabaseConfiguration(com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration) BaseConfiguration(org.apache.commons.configuration.BaseConfiguration)

Example 60 with BaseConfiguration

use of org.apache.commons.configuration.BaseConfiguration in project titan by thinkaurelius.

the class CassandraStorageSetup method getGenericCassandraStorageConfiguration.

public static Configuration getGenericCassandraStorageConfiguration(String ks) {
    BaseConfiguration config = new BaseConfiguration();
    config.addProperty(KEYSPACE_KEY, cleanKeyspaceName(ks));
    config.addProperty(GraphDatabaseConfiguration.CONNECTION_TIMEOUT_KEY, 60000L);
    return config;
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration)

Aggregations

BaseConfiguration (org.apache.commons.configuration.BaseConfiguration)71 Test (org.junit.Test)24 Configuration (org.apache.commons.configuration.Configuration)19 GraphDatabaseConfiguration (com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration)15 CommonsConfiguration (com.thinkaurelius.titan.diskstorage.configuration.backend.CommonsConfiguration)8 AbstractConfiguration (org.apache.commons.configuration.AbstractConfiguration)7 ExternalView (org.apache.helix.model.ExternalView)7 Test (org.testng.annotations.Test)7 ModifiableConfiguration (com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)5 File (java.io.File)5 InstanceConfig (org.apache.helix.model.InstanceConfig)5 BeforeClass (org.junit.BeforeClass)5 LLCSegmentName (com.linkedin.pinot.common.utils.LLCSegmentName)4 BasicConfiguration (com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration)4 Configuration (com.thinkaurelius.titan.diskstorage.configuration.Configuration)4 ElasticSearchIndex (com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex)4 ArrayList (java.util.ArrayList)4 Map (java.util.Map)4 RoutingTableBuilder (com.linkedin.pinot.routing.builder.RoutingTableBuilder)3 ImmutableMap (com.google.common.collect.ImmutableMap)2