use of org.janusgraph.diskstorage.configuration.WriteConfiguration in project janusgraph by JanusGraph.
the class CassandraGraphTest method testGraphConfigUsedByThreadBoundTx.
@Test
public void testGraphConfigUsedByThreadBoundTx() {
close();
WriteConfiguration wc = getConfiguration();
wc.set(ConfigElement.getPath(CASSANDRA_READ_CONSISTENCY), "ALL");
wc.set(ConfigElement.getPath(CASSANDRA_WRITE_CONSISTENCY), "LOCAL_QUORUM");
graph = (StandardJanusGraph) JanusGraphFactory.open(wc);
StandardJanusGraphTx tx = (StandardJanusGraphTx) graph.getCurrentThreadTx();
assertEquals("ALL", tx.getTxHandle().getBaseTransactionConfig().getCustomOptions().get(AbstractCassandraStoreManager.CASSANDRA_READ_CONSISTENCY));
assertEquals("LOCAL_QUORUM", tx.getTxHandle().getBaseTransactionConfig().getCustomOptions().get(AbstractCassandraStoreManager.CASSANDRA_WRITE_CONSISTENCY));
}
use of org.janusgraph.diskstorage.configuration.WriteConfiguration in project janusgraph by JanusGraph.
the class IDAuthorityTest method setUp.
private void setUp(WriteConfiguration baseConfig) throws Exception {
this.baseStoreConfiguration = baseConfig;
Configuration config = StorageSetup.getConfig(baseConfig);
uidBitWidth = config.get(IDAUTHORITY_CAV_BITS);
// hasFixedUid = !config.get(IDAUTHORITY_RANDOMIZE_UNIQUEID);
hasFixedUid = !ConflictAvoidanceMode.GLOBAL_AUTO.equals(config.get(IDAUTHORITY_CONFLICT_AVOIDANCE));
hasEmptyUid = uidBitWidth == 0;
blockSize = config.get(IDS_BLOCK_SIZE);
StoreManager m = openStorageManager();
m.clearStorage();
m.close();
open();
}
use of org.janusgraph.diskstorage.configuration.WriteConfiguration in project janusgraph by JanusGraph.
the class IDAuthorityTest method checkAndReturnWriteConfiguration.
private static WriteConfiguration checkAndReturnWriteConfiguration(ModifiableConfiguration baseConfig) {
WriteConfiguration writeConfiguration = baseConfig.getConfiguration();
Preconditions.checkNotNull(writeConfiguration);
TestGraphConfigs.applyOverrides(writeConfiguration);
return writeConfiguration;
}
use of org.janusgraph.diskstorage.configuration.WriteConfiguration in project janusgraph by JanusGraph.
the class JanusGraphBaseTest method getForceIndexGraph.
public JanusGraph getForceIndexGraph(WriteConfiguration writeConfiguration) {
final ModifiableConfiguration adjustedConfig = new ModifiableConfiguration(GraphDatabaseConfiguration.ROOT_NS, writeConfiguration, BasicConfiguration.Restriction.NONE);
adjustedConfig.set(GraphDatabaseConfiguration.FORCE_INDEX_USAGE, true);
final WriteConfiguration adjustedWriteConfig = adjustedConfig.getConfiguration();
TestGraphConfigs.applyOverrides(adjustedWriteConfig);
Preconditions.checkNotNull(adjustedWriteConfig);
return JanusGraphFactory.open(adjustedWriteConfig);
}
use of org.janusgraph.diskstorage.configuration.WriteConfiguration in project janusgraph by JanusGraph.
the class AbstractJanusGraphProvider method clear.
@Override
public void clear(Graph g, final Configuration configuration) throws Exception {
if (null != g) {
while (g instanceof WrappedGraph) g = ((WrappedGraph<? extends Graph>) g).getBaseGraph();
JanusGraph graph = (JanusGraph) g;
if (graph.isOpen()) {
if (g.tx().isOpen())
g.tx().rollback();
try {
g.close();
} catch (IOException | IllegalStateException e) {
logger.warn("Titan graph may not have closed cleanly", e);
}
}
}
WriteConfiguration config = new CommonsConfiguration(configuration);
BasicConfiguration readConfig = new BasicConfiguration(GraphDatabaseConfiguration.ROOT_NS, config, BasicConfiguration.Restriction.NONE);
if (readConfig.has(GraphDatabaseConfiguration.STORAGE_BACKEND)) {
JanusGraphBaseTest.clearGraph(config);
}
}
Aggregations