Search in sources :

Example 21 with ModifiableConfiguration

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

the class CassandraThriftStoreManagerTest method configOptionFrameSizeMbShouldErrorOnLowValue.

@Test(expected = IllegalArgumentException.class)
public void configOptionFrameSizeMbShouldErrorOnLowValue() {
    ModifiableConfiguration config = CassandraStorageSetup.getCassandraThriftConfiguration("janusgraph");
    config.set(CassandraThriftStoreManager.THRIFT_FRAME_SIZE_MB, 0);
    config.get(CassandraThriftStoreManager.THRIFT_FRAME_SIZE_MB);
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) Test(org.junit.Test)

Example 22 with ModifiableConfiguration

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

the class CQLGraphComputerProvider method getJanusGraphConfiguration.

@Override
public ModifiableConfiguration getJanusGraphConfiguration(String graphName, Class<?> test, String testMethodName) {
    CassandraStorageSetup.startCleanEmbedded();
    ModifiableConfiguration config = super.getJanusGraphConfiguration(graphName, test, testMethodName);
    config.setAll(CassandraStorageSetup.getCQLConfiguration(graphName).getAll());
    return config;
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration)

Example 23 with ModifiableConfiguration

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

the class ElasticSearchConfigTest method testIndexCreationOptions.

@Test
public void testIndexCreationOptions() throws InterruptedException, BackendException, IOException {
    final int shards = 7;
    final CommonsConfiguration cc = new CommonsConfiguration(new BaseConfiguration());
    cc.set("index." + INDEX_NAME + ".elasticsearch.create.ext.number_of_shards", String.valueOf(shards));
    final ModifiableConfiguration config = new ModifiableConfiguration(GraphDatabaseConfiguration.ROOT_NS, cc, BasicConfiguration.Restriction.NONE);
    esr.setElasticsearchConfiguration(config, INDEX_NAME);
    final Configuration indexConfig = config.restrictTo(INDEX_NAME);
    final IndexProvider idx = open(indexConfig);
    simpleWriteAndQuery(idx);
    idx.close();
    final ElasticSearchClient client = ElasticSearchSetup.REST_CLIENT.connect(indexConfig).getClient();
    assertEquals(String.valueOf(shards), client.getIndexSettings("janusgraph_jvmlocal_test_store").get("number_of_shards"));
    client.close();
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) Configuration(org.janusgraph.diskstorage.configuration.Configuration) CommonsConfiguration(org.janusgraph.diskstorage.configuration.backend.CommonsConfiguration) GraphDatabaseConfiguration(org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration) BasicConfiguration(org.janusgraph.diskstorage.configuration.BasicConfiguration) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) CommonsConfiguration(org.janusgraph.diskstorage.configuration.backend.CommonsConfiguration) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) Test(org.junit.Test)

Example 24 with ModifiableConfiguration

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

the class ElasticSearchConfigTest method testSplitIndexToMultiType.

@Test
public void testSplitIndexToMultiType() throws InterruptedException, BackendException, IOException {
    final ModifiableConfiguration config = esr.setElasticsearchConfiguration(GraphDatabaseConfiguration.buildGraphConfiguration(), INDEX_NAME);
    config.set(USE_DEPRECATED_MULTITYPE_INDEX, false, INDEX_NAME);
    Configuration indexConfig = config.restrictTo(INDEX_NAME);
    final IndexProvider idx = open(indexConfig);
    simpleWriteAndQuery(idx);
    try {
        config.set(USE_DEPRECATED_MULTITYPE_INDEX, true, INDEX_NAME);
        indexConfig = config.restrictTo(INDEX_NAME);
        open(indexConfig);
        fail("should fail");
    } catch (final IllegalArgumentException ignored) {
    }
    idx.close();
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) Configuration(org.janusgraph.diskstorage.configuration.Configuration) CommonsConfiguration(org.janusgraph.diskstorage.configuration.backend.CommonsConfiguration) GraphDatabaseConfiguration(org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration) BasicConfiguration(org.janusgraph.diskstorage.configuration.BasicConfiguration) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) Test(org.junit.Test)

Example 25 with ModifiableConfiguration

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

the class ElasticSearchConfigTest method testMultiTypeToSplitIndex.

@Test
public void testMultiTypeToSplitIndex() throws InterruptedException, BackendException, IOException {
    final ModifiableConfiguration config = esr.setElasticsearchConfiguration(GraphDatabaseConfiguration.buildGraphConfiguration(), INDEX_NAME);
    config.set(USE_DEPRECATED_MULTITYPE_INDEX, true, INDEX_NAME);
    Configuration indexConfig = config.restrictTo(INDEX_NAME);
    final IndexProvider idx = open(indexConfig);
    simpleWriteAndQuery(idx);
    try {
        config.set(USE_DEPRECATED_MULTITYPE_INDEX, false, INDEX_NAME);
        indexConfig = config.restrictTo(INDEX_NAME);
        open(indexConfig);
        fail("should fail");
    } catch (final IllegalArgumentException ignored) {
    }
    idx.close();
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) Configuration(org.janusgraph.diskstorage.configuration.Configuration) CommonsConfiguration(org.janusgraph.diskstorage.configuration.backend.CommonsConfiguration) GraphDatabaseConfiguration(org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration) BasicConfiguration(org.janusgraph.diskstorage.configuration.BasicConfiguration) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) 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