use of org.apache.tinkerpop.gremlin.orientdb.OrientGraphFactory in project open-kilda by telstra.
the class OrientDbGraphFactory method getGraph.
/**
* Returns an instance of framed graph which is bound to the current persistence context.
* Create a new one if there's no such.
*/
@Override
public DelegatingFramedGraph<OrientGraph> getGraph() {
Connect effectiveConnect = getConnectCreateIfMissing();
OrientGraphFactory factory = effectiveConnect.getFactory();
log.debug("Opening a framed graph for {}", factory);
OrientGraph orientGraph = Failsafe.with(newPoolAcquireRetryPolicy()).get(() -> {
OrientGraph obtainedGraph = factory.getTx();
validateGraph(obtainedGraph);
return obtainedGraph;
});
log.debug("OrientGraph instance has been created: {}", orientGraph);
return new DelegatingFramedGraph<>(orientGraph, effectiveConnect.getBuilder(), effectiveConnect.getTypeResolver());
}
Aggregations