public final class TinkerGraphComputer extends Object implements GraphComputer
GraphComputer.Exceptions, GraphComputer.Features, GraphComputer.Persist, GraphComputer.ResultGraph
Constructor and Description |
---|
TinkerGraphComputer(TinkerGraph graph) |
Modifier and Type | Method and Description |
---|---|
GraphComputer |
edges(Traversal<Vertex,Edge> edgeFilter)
Add a filter that will limit which edges of the vertices are loaded from the graph source.
|
GraphComputer.Features |
features() |
GraphComputer |
mapReduce(MapReduce mapReduce)
Add a
MapReduce job to the set of MapReduce jobs to be executed by the GraphComputer . |
GraphComputer |
persist(GraphComputer.Persist persist)
Set the
GraphComputer.Persist level of the computation. |
GraphComputer |
program(VertexProgram vertexProgram)
Set the
VertexProgram to be executed by the GraphComputer . |
GraphComputer |
result(GraphComputer.ResultGraph resultGraph)
Set the
GraphComputer.ResultGraph of the computation. |
Future<ComputerResult> |
submit()
|
String |
toString() |
GraphComputer |
vertices(Traversal<Vertex,Vertex> vertexFilter)
Add a filter that will limit which vertices are loaded from the graph source.
|
GraphComputer |
workers(int workers)
Set the desired number of workers to execute the
VertexProgram and MapReduce jobs. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
configure
public TinkerGraphComputer(TinkerGraph graph)
public GraphComputer result(GraphComputer.ResultGraph resultGraph)
GraphComputer
GraphComputer.ResultGraph
of the computation.
If this is not set explicitly by the user, then the VertexProgram
can choose the most efficient result for its intended use.
If there is no declared vertex program, then the GraphComputer
defaults to GraphComputer.ResultGraph.ORIGINAL
.result
in interface GraphComputer
resultGraph
- the type of graph to be returned by ComputerResult.graph()
public GraphComputer persist(GraphComputer.Persist persist)
GraphComputer
GraphComputer.Persist
level of the computation.
If this is not set explicitly by the user, then the VertexProgram
can choose the most efficient persist for the its intended use.
If there is no declared vertex program, then the GraphComputer
defaults to GraphComputer.Persist.NOTHING
.persist
in interface GraphComputer
persist
- the persistence level of the resultant computationpublic GraphComputer program(VertexProgram vertexProgram)
GraphComputer
VertexProgram
to be executed by the GraphComputer
.
There can only be one VertexProgram for the GraphComputer.program
in interface GraphComputer
vertexProgram
- the VertexProgram to be executedpublic GraphComputer mapReduce(MapReduce mapReduce)
GraphComputer
MapReduce
job to the set of MapReduce jobs to be executed by the GraphComputer
.
There can be any number of MapReduce jobs.mapReduce
in interface GraphComputer
mapReduce
- the MapReduce job to add to the computationpublic GraphComputer workers(int workers)
GraphComputer
VertexProgram
and MapReduce
jobs.
This is a recommendation to the underlying GraphComputer
implementation and is allowed to deviate accordingly by the implementation.workers
in interface GraphComputer
workers
- the number of workers to execute the submissionpublic GraphComputer vertices(Traversal<Vertex,Vertex> vertexFilter)
GraphComputer
Traversal
can only check the vertex, its vertex properties, and the vertex property properties.
The loaded graph will only have those vertices that pass through the provided filter.vertices
in interface GraphComputer
vertexFilter
- the traversal to verify whether or not to load the current vertexpublic GraphComputer edges(Traversal<Vertex,Edge> edgeFilter)
GraphComputer
Traversal
can only check the local star graph of the vertex and thus,
can not access properties/labels of the adjacent vertices.
The vertices of the loaded graph will only have those edges that pass through the provided filter.edges
in interface GraphComputer
edgeFilter
- the traversal that determines which edges are loaded for each vertexpublic Future<ComputerResult> submit()
GraphComputer
submit
in interface GraphComputer
Future
denoting a reference to the asynchronous computation and where to get the DefaultComputerResult
when its is complete.public GraphComputer.Features features()
features
in interface GraphComputer
Copyright © 2013–2016 Apache Software Foundation. All rights reserved.