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);
}
}
}
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;
}
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;
}
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));
}
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));
}
Aggregations