use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class AbstractCassandraStoreTest method testDisableCFCompressor.
@Test
public void testDisableCFCompressor() throws BackendException {
final String cf = TEST_CF_NAME + "_nocompress";
ModifiableConfiguration config = getBaseStorageConfiguration();
config.set(AbstractCassandraStoreManager.CF_COMPRESSION, false);
AbstractCassandraStoreManager mgr = openStorageManager(config);
// N.B.: clearStorage() truncates CFs but does not delete them
mgr.openDatabase(cf);
assertEquals(Collections.emptyMap(), mgr.getCompressionOptions(cf));
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class CassandraStorageSetup method getGenericConfiguration.
private static ModifiableConfiguration getGenericConfiguration(String ks, String backend) {
ModifiableConfiguration config = buildGraphConfiguration();
if (null != ks) {
config.set(CASSANDRA_KEYSPACE, cleanKeyspaceName(ks));
log.debug("Set keyspace name: {}", config.get(CASSANDRA_KEYSPACE));
}
config.set(PAGE_SIZE, 500);
config.set(CONNECTION_TIMEOUT, Duration.ofSeconds(60L));
config.set(STORAGE_BACKEND, backend);
if (HOSTNAME != null)
config.set(STORAGE_HOSTS, new String[] { HOSTNAME });
config.set(DROP_ON_CLEAR, false);
return config;
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class ThriftGraphComputerProvider method getJanusGraphConfiguration.
@Override
public ModifiableConfiguration getJanusGraphConfiguration(String graphName, Class<?> test, String testMethodName) {
CassandraStorageSetup.startCleanEmbedded();
ModifiableConfiguration config = super.getJanusGraphConfiguration(graphName, test, testMethodName);
config.setAll(CassandraStorageSetup.getCassandraThriftConfiguration(graphName).getAll());
return config;
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class CQLStoreTest method testDisableCFCompressor.
@Test
public void testDisableCFCompressor() throws BackendException {
final String cf = TEST_CF_NAME + "_nocompress";
final ModifiableConfiguration config = getBaseStorageConfiguration();
config.set(CF_COMPRESSION, false);
final CQLStoreManager mgr = openStorageManager(config);
// N.B.: clearStorage() truncates CFs but does not delete them
mgr.openDatabase(cf);
final Map<String, String> opts = new HashMap<>(mgr.getCompressionOptions(cf));
if ("false".equals(opts.get("enabled"))) {
// Cassandra 3.x contains {"enabled": false"} mapping not found in 2.x
opts.remove("enabled");
}
assertEquals(Collections.emptyMap(), opts);
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class CQLStoreTest method testCustomCFCompressor.
@Test
public void testCustomCFCompressor() throws BackendException {
final String cname = "DeflateCompressor";
final int ckb = 128;
final String cf = TEST_CF_NAME + "_gzip";
final ModifiableConfiguration config = getBaseStorageConfiguration();
config.set(CF_COMPRESSION_TYPE, cname);
config.set(CF_COMPRESSION_BLOCK_SIZE, ckb);
final CQLStoreManager mgr = openStorageManager(config);
// N.B.: clearStorage() truncates CFs but does not delete them
mgr.openDatabase(cf);
final Map<String, String> opts = mgr.getCompressionOptions(cf);
assertEquals(2, opts.size());
// chunk length key differs between 2.x (chunk_length_kb) and 3.x (chunk_length_in_kb)
assertEquals(String.valueOf(ckb), opts.getOrDefault("chunk_length_kb", opts.get("chunk_length_in_kb")));
// compression class key differs between 2.x (sstable_compression) and 3.x (class)
assertEquals(DEFAULT_COMPRESSOR_PACKAGE + "." + cname, opts.getOrDefault("sstable_compression", opts.get("class")));
}
Aggregations