use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class JanusGraphPartitionGraphTest method getConfiguration.
@Override
public WriteConfiguration getConfiguration() {
WriteConfiguration config = getBaseConfiguration();
ModifiableConfiguration modifiableConfiguration = new ModifiableConfiguration(GraphDatabaseConfiguration.ROOT_NS, config, BasicConfiguration.Restriction.NONE);
// Let GraphDatabaseConfiguration's config freezer set CLUSTER_PARTITION
// modifiableConfiguration.set(GraphDatabaseConfiguration.CLUSTER_PARTITION,true);
modifiableConfiguration.set(GraphDatabaseConfiguration.CLUSTER_MAX_PARTITIONS, numPartitions);
// uses SimpleBulkPlacementStrategy by default
modifiableConfiguration.set(SimpleBulkPlacementStrategy.CONCURRENT_PARTITIONS, 3 * numPartitions);
return config;
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class VertexIDAssignerTest method getInMemoryGraph.
private JanusGraph getInMemoryGraph(boolean allowSettingVertexId, boolean idsFlush) {
ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
config.set(GraphDatabaseConfiguration.STORAGE_BACKEND, InMemoryStoreManager.class.getCanonicalName());
config.set(GraphDatabaseConfiguration.IDS_FLUSH, idsFlush);
config.set(GraphDatabaseConfiguration.IDAUTHORITY_WAIT, Duration.ofMillis(1L));
config.set(GraphDatabaseConfiguration.CLUSTER_MAX_PARTITIONS, 1 << numPartitionsBits);
config.set(GraphDatabaseConfiguration.ALLOW_SETTING_VERTEX_ID, allowSettingVertexId);
return JanusGraphFactory.open(config);
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class InMemoryGraphTest method clopen.
@Override
public void clopen(Object... settings) {
if (settings != null && settings.length > 0) {
if (graph != null && graph.isOpen()) {
Preconditions.checkArgument(!graph.vertices().hasNext() && !graph.edges().hasNext(), "Graph cannot be re-initialized for InMemory since that would delete all data");
graph.close();
}
Map<TestConfigOption, Object> options = validateConfigOptions(settings);
ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
config.set(GraphDatabaseConfiguration.STORAGE_BACKEND, "inmemory");
for (Map.Entry<TestConfigOption, Object> option : options.entrySet()) {
config.set(option.getKey().option, option.getValue(), option.getKey().umbrella);
}
open(config.getConfiguration());
}
newTx();
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class InMemoryGraphTest method getConfiguration.
public WriteConfiguration getConfiguration() {
ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
config.set(GraphDatabaseConfiguration.STORAGE_BACKEND, "inmemory");
return config.getConfiguration();
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class InMemoryJanusGraphIoTest method clopen.
@Override
public void clopen(Object... settings) {
if (settings != null && settings.length > 0) {
if (graph != null && graph.isOpen()) {
Preconditions.checkArgument(!graph.vertices().hasNext() && !graph.edges().hasNext(), "Graph cannot be re-initialized for InMemory since that would delete all data");
graph.close();
}
Map<JanusGraphBaseTest.TestConfigOption, Object> options = validateConfigOptions(settings);
ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
config.set(GraphDatabaseConfiguration.STORAGE_BACKEND, "inmemory");
for (Map.Entry<JanusGraphBaseTest.TestConfigOption, Object> option : options.entrySet()) {
config.set(option.getKey().option, option.getValue(), option.getKey().umbrella);
}
open(config.getConfiguration());
}
newTx();
}
Aggregations