本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.Graph.compute方法的典型用法代码示例。如果您正苦于以下问题:Java Graph.compute方法的具体用法?Java Graph.compute怎么用?Java Graph.compute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.structure.Graph
的用法示例。
在下文中一共展示了Graph.compute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.apache.tinkerpop.gremlin.structure.Graph; //导入方法依赖的package包/类
public GraphComputer apply(final Graph graph) {
GraphComputer computer = this.graphComputerClass.equals(GraphComputer.class) ? graph.compute() : graph.compute(this.graphComputerClass);
for (final Map.Entry<String, Object> entry : this.configuration.entrySet()) {
computer = computer.configure(entry.getKey(), entry.getValue());
}
if (-1 != this.workers)
computer = computer.workers(this.workers);
if (null != this.persist)
computer = computer.persist(this.persist);
if (null != this.resultGraph)
computer = computer.result(this.resultGraph);
if (null != this.vertices)
computer = computer.vertices(this.vertices);
if (null != this.edges)
computer.edges(this.edges);
return computer;
}
示例2: create
import org.apache.tinkerpop.gremlin.structure.Graph; //导入方法依赖的package包/类
/**
* @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
*/
@Deprecated
public ComputerTraversalEngine create(final Graph graph) {
GraphComputer graphComputer = null == this.graphComputerClass ? graph.compute() : graph.compute(this.graphComputerClass);
if (-1 != this.workers)
graphComputer = graphComputer.workers(this.workers);
if (null != this.vertexFilter)
graphComputer = graphComputer.vertices(this.vertexFilter);
if (null != this.edgeFilter)
graphComputer = graphComputer.edges(this.edgeFilter);
return new ComputerTraversalEngine(graphComputer);
}
示例3: getGraphComputer
import org.apache.tinkerpop.gremlin.structure.Graph; //导入方法依赖的package包/类
@Override
public GraphComputer getGraphComputer(final Graph graph) {
return graph.compute(GiraphGraphComputer.class);
}
示例4: getGraphComputer
import org.apache.tinkerpop.gremlin.structure.Graph; //导入方法依赖的package包/类
@Override
public GraphComputer getGraphComputer(final Graph graph) {
return RANDOM.nextBoolean() ?
graph.compute().workers(RANDOM.nextInt(3) + 1) :
graph.compute(SparkGraphComputer.class);
}
示例5: getGraphComputer
import org.apache.tinkerpop.gremlin.structure.Graph; //导入方法依赖的package包/类
/**
* Create a {@link GraphComputer} from the {@link Graph} instance. The default implementation simply calls {@code graph.compute()}.
*
* @param graph the graph to get the graph computer from
* @return a new graph computer
*/
public default GraphComputer getGraphComputer(final Graph graph) {
return graph.compute();
}