Search in sources :

Example 61 with BaseConfiguration

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

the class BerkeleyJEBlueprintsTest method cleanUp.

@Override
public void cleanUp() throws StorageException {
    synchronized (openDirs) {
        for (String dir : openDirs) {
            BaseConfiguration config = new BaseConfiguration();
            config.addProperty(GraphDatabaseConfiguration.STORAGE_DIRECTORY_KEY, dir);
            BerkeleyJEStoreManager s = new BerkeleyJEStoreManager(config);
            s.clearStorage();
            File dirFile = new File(dir);
            Assert.assertFalse(dirFile.exists() && dirFile.listFiles().length > 0);
        }
    }
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) BerkeleyJEStoreManager(com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager) File(java.io.File)

Example 62 with BaseConfiguration

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

the class BerkeleyJeStorageSetup method getBerkeleyJEGraphBaseConfiguration.

public static Configuration getBerkeleyJEGraphBaseConfiguration() {
    BaseConfiguration config = new BaseConfiguration();
    Configuration storage = config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE);
    storage.addProperty(GraphDatabaseConfiguration.STORAGE_DIRECTORY_KEY, getHomeDir());
    storage.addProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, "berkeleyje");
    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 63 with BaseConfiguration

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

the class BerkeleyJeStorageSetup method getBerkeleyJEStorageConfiguration.

public static Configuration getBerkeleyJEStorageConfiguration() {
    BaseConfiguration config = new BaseConfiguration();
    config.addProperty(GraphDatabaseConfiguration.STORAGE_DIRECTORY_KEY, getHomeDir());
    return config;
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration)

Example 64 with BaseConfiguration

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

the class AbstractCassandraKeyColumnValueStoreTest method testCustomCFCompressor.

@Test
public void testCustomCFCompressor() throws StorageException {
    final String cname = "DeflateCompressor";
    final String ckb = "128";
    final String cf = TEST_CF_NAME + "_gzip";
    Configuration gzipCompressorCfg = new BaseConfiguration();
    gzipCompressorCfg.setProperty(AbstractCassandraStoreManager.COMPRESSION_KEY, cname);
    gzipCompressorCfg.setProperty(AbstractCassandraStoreManager.COMPRESSION_CHUNKS_SIZE_KEY, ckb);
    gzipCompressorCfg = new CompositeConfiguration(Arrays.asList(gzipCompressorCfg, getBaseStorageConfiguration()));
    AbstractCassandraStoreManager mgr = openStorageManager(gzipCompressorCfg);
    // 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 + "." + cname).put("chunk_length_kb", ckb).build();
    assertEquals(expected, mgr.getCompressionOptions(cf));
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) Configuration(org.apache.commons.configuration.Configuration) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) Test(org.junit.Test) KeyColumnValueStoreTest(com.thinkaurelius.titan.diskstorage.KeyColumnValueStoreTest)

Example 65 with BaseConfiguration

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

the class AbstractCassandraKeyColumnValueStoreTest method testDisableCFCompressor.

@Test
public void testDisableCFCompressor() throws StorageException {
    final String cf = TEST_CF_NAME + "_nocompress";
    Configuration noCompressorCfg = new BaseConfiguration();
    noCompressorCfg.setProperty(AbstractCassandraStoreManager.ENABLE_COMPRESSION_KEY, "false");
    noCompressorCfg = new CompositeConfiguration(Arrays.asList(noCompressorCfg, getBaseStorageConfiguration()));
    AbstractCassandraStoreManager mgr = openStorageManager(noCompressorCfg);
    // N.B.: clearStorage() truncates CFs but does not delete them
    mgr.openDatabase(cf);
    assertEquals(Collections.emptyMap(), mgr.getCompressionOptions(cf));
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) Configuration(org.apache.commons.configuration.Configuration) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) Test(org.junit.Test) KeyColumnValueStoreTest(com.thinkaurelius.titan.diskstorage.KeyColumnValueStoreTest)

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