Search in sources :

Example 16 with ModifiableConfiguration

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

the class BerkeleyLuceneTest method getConfiguration.

@Override
public WriteConfiguration getConfiguration() {
    ModifiableConfiguration config = getBerkeleyJEConfiguration();
    // Add index
    config.set(INDEX_BACKEND, "lucene", INDEX);
    config.set(INDEX_DIRECTORY, StorageSetup.getHomeDir("lucene"), INDEX);
    return config.getConfiguration();
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration)

Example 17 with ModifiableConfiguration

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

the class LuceneIndexTest method getLocalLuceneTestConfig.

public static Configuration getLocalLuceneTestConfig() {
    final String index = "lucene";
    ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
    config.set(GraphDatabaseConfiguration.INDEX_DIRECTORY, StorageSetup.getHomeDir("lucene"), index);
    return config.restrictTo(index);
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration)

Example 18 with ModifiableConfiguration

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

the class CassandraStorageSetup method getEmbeddedConfiguration.

public static ModifiableConfiguration getEmbeddedConfiguration(String ks) {
    ModifiableConfiguration config = getGenericConfiguration(ks, "embeddedcassandra");
    config.set(STORAGE_CONF_FILE, getPaths().yamlPath);
    return config;
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration)

Example 19 with ModifiableConfiguration

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

the class CassandraStorageSetup method getEmbeddedCassandraPartitionConfiguration.

public static ModifiableConfiguration getEmbeddedCassandraPartitionConfiguration(String ks) {
    ModifiableConfiguration config = getEmbeddedConfiguration(ks);
    config.set(IDS_FLUSH, false);
    return config;
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration)

Example 20 with ModifiableConfiguration

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

the class CassandraTransactionTest method testWriteConsistencyLevel.

/* testRead/WriteConsistencyLevel have unnecessary code duplication
     * that could be avoided by creating a common helper method that takes
     * a ConfigOption parameter and a function that converts a
     * CassandraTransaction to a consistency level by calling either
     * ct.getReadConsistencyLevel() or .getWriteConsistencyLevel(),
     * but it doesn't seem worth the complexity.
     */
@Test
public void testWriteConsistencyLevel() {
    int levelsChecked = 0;
    // Test whether CassandraTransaction honors the write consistency level option
    for (CLevel writeLevel : CLevel.values()) {
        StandardBaseTransactionConfig.Builder b = new StandardBaseTransactionConfig.Builder();
        ModifiableConfiguration mc = GraphDatabaseConfiguration.buildGraphConfiguration();
        mc.set(CASSANDRA_WRITE_CONSISTENCY, writeLevel.name());
        b.customOptions(mc);
        b.timestampProvider(TimestampProviders.MICRO);
        CassandraTransaction ct = new CassandraTransaction(b.build());
        assertEquals(writeLevel, ct.getWriteConsistencyLevel());
        levelsChecked++;
    }
    // Sanity check: if CLevel.values was empty, something is wrong with the test
    Preconditions.checkState(0 < levelsChecked);
}
Also used : StandardBaseTransactionConfig(org.janusgraph.diskstorage.util.StandardBaseTransactionConfig) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) Test(org.junit.Test)

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