Search in sources :

Example 31 with ModifiableConfiguration

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

the class CassandraThriftStoreManagerTest method configOptionFrameSizeMbShouldErrorOnHighValue.

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

Example 32 with ModifiableConfiguration

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

the class CassandraThriftStoreManagerTest method configOptionFrameSizeMbShouldBeHappy.

@Test
public void configOptionFrameSizeMbShouldBeHappy() {
    ModifiableConfiguration config = CassandraStorageSetup.getCassandraThriftConfiguration("janusgraph");
    config.set(CassandraThriftStoreManager.THRIFT_FRAME_SIZE_MB, 1);
    Integer result = config.get(CassandraThriftStoreManager.THRIFT_FRAME_SIZE_MB);
    assertEquals(1, result.intValue());
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) Test(org.junit.Test)

Example 33 with ModifiableConfiguration

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

the class AbstractCassandraStoreTest method keyspaceShouldBeEquivalentToGraphName.

@Test
public void keyspaceShouldBeEquivalentToGraphName() throws BackendException {
    final ModifiableConfiguration config = getBaseStorageConfiguration(null);
    config.set(GraphDatabaseConfiguration.GRAPH_NAME, "randomNewGraphName");
    final AbstractCassandraStoreManager mgr = openStorageManager(config);
    assertEquals("randomNewGraphName", mgr.keySpaceName);
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) KeyColumnValueStoreTest(org.janusgraph.diskstorage.KeyColumnValueStoreTest) Test(org.junit.Test)

Example 34 with ModifiableConfiguration

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

the class AbstractCassandraStoreTest method testCustomCFCompressor.

@Test
public void testCustomCFCompressor() throws BackendException {
    final String compressor = "DeflateCompressor";
    final int ckb = 128;
    final String cf = TEST_CF_NAME + "_gzip";
    ModifiableConfiguration config = getBaseStorageConfiguration();
    config.set(AbstractCassandraStoreManager.CF_COMPRESSION_TYPE, compressor);
    config.set(AbstractCassandraStoreManager.CF_COMPRESSION_BLOCK_SIZE, ckb);
    AbstractCassandraStoreManager mgr = openStorageManager(config);
    // N.B.: clearStorage() truncates CFs but does not delete them
    mgr.openDatabase(cf);
    final Map<String, String> expected = ImmutableMap.<String, String>builder().put("sstable_compression", DEFAULT_COMPRESSOR_PACKAGE + "." + compressor).put("chunk_length_kb", String.valueOf(ckb)).build();
    assertEquals(expected, mgr.getCompressionOptions(cf));
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) KeyColumnValueStoreTest(org.janusgraph.diskstorage.KeyColumnValueStoreTest) Test(org.junit.Test)

Example 35 with ModifiableConfiguration

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

the class AbstractCassandraStoreTest method keyspaceShouldBeEquivalentToProvidedOne.

@Test
public void keyspaceShouldBeEquivalentToProvidedOne() throws BackendException {
    final ModifiableConfiguration config = getBaseStorageConfiguration("randomNewKeyspace");
    final AbstractCassandraStoreManager mgr = openStorageManager(config);
    assertEquals("randomNewKeyspace", mgr.keySpaceName);
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) KeyColumnValueStoreTest(org.janusgraph.diskstorage.KeyColumnValueStoreTest) 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