Search in sources :

Example 56 with ModifiableConfiguration

use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.

the class JanusGraphPartitionGraphTest method getConfiguration.

@Override
public WriteConfiguration getConfiguration() {
    WriteConfiguration config = getBaseConfiguration();
    ModifiableConfiguration modifiableConfiguration = new ModifiableConfiguration(GraphDatabaseConfiguration.ROOT_NS, config, BasicConfiguration.Restriction.NONE);
    // Let GraphDatabaseConfiguration's config freezer set CLUSTER_PARTITION
    // modifiableConfiguration.set(GraphDatabaseConfiguration.CLUSTER_PARTITION,true);
    modifiableConfiguration.set(GraphDatabaseConfiguration.CLUSTER_MAX_PARTITIONS, numPartitions);
    // uses SimpleBulkPlacementStrategy by default
    modifiableConfiguration.set(SimpleBulkPlacementStrategy.CONCURRENT_PARTITIONS, 3 * numPartitions);
    return config;
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) WriteConfiguration(org.janusgraph.diskstorage.configuration.WriteConfiguration)

Example 57 with ModifiableConfiguration

use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.

the class VertexIDAssignerTest method getInMemoryGraph.

private JanusGraph getInMemoryGraph(boolean allowSettingVertexId, boolean idsFlush) {
    ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
    config.set(GraphDatabaseConfiguration.STORAGE_BACKEND, InMemoryStoreManager.class.getCanonicalName());
    config.set(GraphDatabaseConfiguration.IDS_FLUSH, idsFlush);
    config.set(GraphDatabaseConfiguration.IDAUTHORITY_WAIT, Duration.ofMillis(1L));
    config.set(GraphDatabaseConfiguration.CLUSTER_MAX_PARTITIONS, 1 << numPartitionsBits);
    config.set(GraphDatabaseConfiguration.ALLOW_SETTING_VERTEX_ID, allowSettingVertexId);
    return JanusGraphFactory.open(config);
}
Also used : InMemoryStoreManager(org.janusgraph.diskstorage.keycolumnvalue.inmemory.InMemoryStoreManager) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration)

Example 58 with ModifiableConfiguration

use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.

the class InMemoryGraphTest method clopen.

@Override
public void clopen(Object... settings) {
    if (settings != null && settings.length > 0) {
        if (graph != null && graph.isOpen()) {
            Preconditions.checkArgument(!graph.vertices().hasNext() && !graph.edges().hasNext(), "Graph cannot be re-initialized for InMemory since that would delete all data");
            graph.close();
        }
        Map<TestConfigOption, Object> options = validateConfigOptions(settings);
        ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
        config.set(GraphDatabaseConfiguration.STORAGE_BACKEND, "inmemory");
        for (Map.Entry<TestConfigOption, Object> option : options.entrySet()) {
            config.set(option.getKey().option, option.getValue(), option.getKey().umbrella);
        }
        open(config.getConfiguration());
    }
    newTx();
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) Map(java.util.Map)

Example 59 with ModifiableConfiguration

use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.

the class InMemoryGraphTest method getConfiguration.

public WriteConfiguration getConfiguration() {
    ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
    config.set(GraphDatabaseConfiguration.STORAGE_BACKEND, "inmemory");
    return config.getConfiguration();
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration)

Example 60 with ModifiableConfiguration

use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.

the class InMemoryJanusGraphIoTest method clopen.

@Override
public void clopen(Object... settings) {
    if (settings != null && settings.length > 0) {
        if (graph != null && graph.isOpen()) {
            Preconditions.checkArgument(!graph.vertices().hasNext() && !graph.edges().hasNext(), "Graph cannot be re-initialized for InMemory since that would delete all data");
            graph.close();
        }
        Map<JanusGraphBaseTest.TestConfigOption, Object> options = validateConfigOptions(settings);
        ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
        config.set(GraphDatabaseConfiguration.STORAGE_BACKEND, "inmemory");
        for (Map.Entry<JanusGraphBaseTest.TestConfigOption, Object> option : options.entrySet()) {
            config.set(option.getKey().option, option.getValue(), option.getKey().umbrella);
        }
        open(config.getConfiguration());
    }
    newTx();
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) Map(java.util.Map)

Aggregations

ModifiableConfiguration (org.janusgraph.diskstorage.configuration.ModifiableConfiguration)62 Test (org.junit.Test)16 BaseConfiguration (org.apache.commons.configuration.BaseConfiguration)10 CommonsConfiguration (org.janusgraph.diskstorage.configuration.backend.CommonsConfiguration)10 KeyColumnValueStoreTest (org.janusgraph.diskstorage.KeyColumnValueStoreTest)6 BasicConfiguration (org.janusgraph.diskstorage.configuration.BasicConfiguration)5 Configuration (org.janusgraph.diskstorage.configuration.Configuration)5 GraphDatabaseConfiguration (org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration)5 HashMap (java.util.HashMap)3 Map (java.util.Map)3 StandardBaseTransactionConfig (org.janusgraph.diskstorage.util.StandardBaseTransactionConfig)3 WriteConfiguration (org.janusgraph.diskstorage.configuration.WriteConfiguration)2 InMemoryStoreManager (org.janusgraph.diskstorage.keycolumnvalue.inmemory.InMemoryStoreManager)2 IndexRemoveJob (org.janusgraph.graphdb.olap.job.IndexRemoveJob)2 IndexRepairJob (org.janusgraph.graphdb.olap.job.IndexRepairJob)2 CassandraHadoopScanRunner (org.janusgraph.hadoop.scan.CassandraHadoopScanRunner)2 HBaseHadoopScanRunner (org.janusgraph.hadoop.scan.HBaseHadoopScanRunner)2 Before (org.junit.Before)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 IOException (java.io.IOException)1