use of org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies in project janusgraph by JanusGraph.
the class JanusGraphStepStrategyTest method doTest.
@Test
public void doTest() {
final TraversalStrategies strategies = new DefaultTraversalStrategies();
strategies.addStrategies(JanusGraphStepStrategy.instance());
for (final TraversalStrategy strategy : this.otherStrategies) {
strategies.addStrategies(strategy);
}
this.original.asAdmin().setStrategies(strategies);
this.original.asAdmin().applyStrategies();
assertEquals(this.optimized, this.original);
}
use of org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies in project grakn by graknlabs.
the class TxFactoryJanus method newJanusGraph.
private synchronized JanusGraph newJanusGraph(boolean batchLoading) {
JanusGraph JanusGraph = configureGraph(batchLoading);
buildJanusIndexes(JanusGraph);
JanusGraph.tx().onClose(Transaction.CLOSE_BEHAVIOR.ROLLBACK);
if (!strategiesApplied.getAndSet(true)) {
TraversalStrategies strategies = TraversalStrategies.GlobalCache.getStrategies(StandardJanusGraph.class);
strategies = strategies.clone().addStrategies(new JanusPreviousPropertyStepStrategy());
// TODO: find out why Tinkerpop added these strategies. They result in many NoOpBarrier steps which slowed down our queries so we had to remove them.
strategies.removeStrategies(PathRetractionStrategy.class, LazyBarrierStrategy.class);
TraversalStrategies.GlobalCache.registerStrategies(StandardJanusGraph.class, strategies);
TraversalStrategies.GlobalCache.registerStrategies(StandardJanusGraphTx.class, strategies);
}
return JanusGraph;
}
Aggregations