use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class BerkeleyLuceneTest method getConfiguration.
@Override
public WriteConfiguration getConfiguration() {
ModifiableConfiguration config = getBerkeleyJEConfiguration();
// Add index
config.set(INDEX_BACKEND, "lucene", INDEX);
config.set(INDEX_DIRECTORY, StorageSetup.getHomeDir("lucene"), INDEX);
return config.getConfiguration();
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class LuceneIndexTest method getLocalLuceneTestConfig.
public static Configuration getLocalLuceneTestConfig() {
final String index = "lucene";
ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
config.set(GraphDatabaseConfiguration.INDEX_DIRECTORY, StorageSetup.getHomeDir("lucene"), index);
return config.restrictTo(index);
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class CassandraStorageSetup method getEmbeddedConfiguration.
public static ModifiableConfiguration getEmbeddedConfiguration(String ks) {
ModifiableConfiguration config = getGenericConfiguration(ks, "embeddedcassandra");
config.set(STORAGE_CONF_FILE, getPaths().yamlPath);
return config;
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class CassandraStorageSetup method getEmbeddedCassandraPartitionConfiguration.
public static ModifiableConfiguration getEmbeddedCassandraPartitionConfiguration(String ks) {
ModifiableConfiguration config = getEmbeddedConfiguration(ks);
config.set(IDS_FLUSH, false);
return config;
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class CassandraTransactionTest method testWriteConsistencyLevel.
/* testRead/WriteConsistencyLevel have unnecessary code duplication
* that could be avoided by creating a common helper method that takes
* a ConfigOption parameter and a function that converts a
* CassandraTransaction to a consistency level by calling either
* ct.getReadConsistencyLevel() or .getWriteConsistencyLevel(),
* but it doesn't seem worth the complexity.
*/
@Test
public void testWriteConsistencyLevel() {
int levelsChecked = 0;
// Test whether CassandraTransaction honors the write consistency level option
for (CLevel writeLevel : CLevel.values()) {
StandardBaseTransactionConfig.Builder b = new StandardBaseTransactionConfig.Builder();
ModifiableConfiguration mc = GraphDatabaseConfiguration.buildGraphConfiguration();
mc.set(CASSANDRA_WRITE_CONSISTENCY, writeLevel.name());
b.customOptions(mc);
b.timestampProvider(TimestampProviders.MICRO);
CassandraTransaction ct = new CassandraTransaction(b.build());
assertEquals(writeLevel, ct.getWriteConsistencyLevel());
levelsChecked++;
}
// Sanity check: if CLevel.values was empty, something is wrong with the test
Preconditions.checkState(0 < levelsChecked);
}
Aggregations