public class MultiVertexCentricQueryBuilder extends AbstractVertexCentricQueryBuilder<MultiVertexCentricQueryBuilder> implements TitanMultiVertexQuery<MultiVertexCentricQueryBuilder>
TitanMultiVertexQuery that extends AbstractVertexCentricQueryBuilder
for all the query building and optimization and adds only the execution logic in
execute(com.thinkaurelius.titan.graphdb.internal.RelationCategory, com.thinkaurelius.titan.graphdb.query.vertex.AbstractVertexCentricQueryBuilder.ResultConstructor).
All other methods just prepare or transform that result set to fit the particular method semantics.AbstractVertexCentricQueryBuilder.RelationConstructor, AbstractVertexCentricQueryBuilder.ResultConstructor<Q>, AbstractVertexCentricQueryBuilder.VertexConstructor, AbstractVertexCentricQueryBuilder.VertexIdConstructortx| Constructor and Description |
|---|
MultiVertexCentricQueryBuilder(StandardTitanTx tx) |
| Modifier and Type | Method and Description |
|---|---|
TitanMultiVertexQuery |
addAllVertices(Collection<TitanVertex> vertices)
Adds the given collection of vertices to the set of vertices against which to execute this query.
|
TitanMultiVertexQuery |
addVertex(TitanVertex vertex)
Adds the given vertex to the set of vertices against which to execute this query.
|
QueryDescription |
describeForEdges()
Returns a description of this query for edges as a
QueryDescription object. |
QueryDescription |
describeForProperties()
Returns a description of this query for properties as a
QueryDescription object. |
protected <Q> Map<TitanVertex,Q> |
execute(RelationCategory returnType,
AbstractVertexCentricQueryBuilder.ResultConstructor<Q> resultConstructor)
Constructs the BaseVertexCentricQuery through
AbstractVertexCentricQueryBuilder.constructQuery(com.thinkaurelius.titan.graphdb.internal.RelationCategory). |
Map<TitanVertex,Iterable<? extends TitanRelation>> |
executeImplicitKeyQuery() |
protected MultiVertexCentricQueryBuilder |
getThis() |
Map<TitanVertex,Iterable<TitanProperty>> |
properties()
Returns an iterable over all incident properties that match this query for each vertex
|
Map<TitanVertex,Iterable<TitanRelation>> |
relations()
Returns an iterable over all incident relations that match this query for each vertex
|
Map<TitanVertex,Iterable<TitanEdge>> |
titanEdges()
Returns an iterable over all incident edges that match this query for each vertex
|
Map<TitanVertex,VertexList> |
vertexIds()
Retrieves all vertices connected to each of the query's central vertices by edges
matching the conditions defined in this query.
|
Map<TitanVertex,Iterable<TitanVertex>> |
vertices()
Retrieves all vertices connected to each of the query's base vertices by edges
matching the conditions defined in this query.
|
adjacent, allRepresentatives, constructQuery, constructQuery, describe, describeForRelations, direction, edges2VertexIds, edges2Vertices, executeImplicitKeyQuery, executeRelations, executeVertexIds, executeVertices, getSingleType, has, has, has, has, has, has, has, hasNot, hasNot, hasSingleType, hasTypes, interval, interval, isImplicitKeyQuery, isPartitionedVertex, keys, labels, limit, noPartitionRestriction, orderBy, orderBy, queryOnlyLoaded, system, type, types, useSimpleQueryProcessorpublic MultiVertexCentricQueryBuilder(StandardTitanTx tx)
protected MultiVertexCentricQueryBuilder getThis()
getThis in class AbstractVertexCentricQueryBuilder<MultiVertexCentricQueryBuilder>public TitanMultiVertexQuery addVertex(TitanVertex vertex)
TitanMultiVertexQueryaddVertex in interface TitanMultiVertexQuery<MultiVertexCentricQueryBuilder>public TitanMultiVertexQuery addAllVertices(Collection<TitanVertex> vertices)
TitanMultiVertexQueryaddAllVertices in interface TitanMultiVertexQuery<MultiVertexCentricQueryBuilder>protected <Q> Map<TitanVertex,Q> execute(RelationCategory returnType, AbstractVertexCentricQueryBuilder.ResultConstructor<Q> resultConstructor)
AbstractVertexCentricQueryBuilder.constructQuery(com.thinkaurelius.titan.graphdb.internal.RelationCategory).
If the query asks for an implicit key, the resulting map is computed and returned directly.
If the query is empty, a map that maps each vertex to an empty list is returned.
Otherwise, the query is executed for all vertices through the transaction which will effectively
pre-load the return result sets into the associated CacheVertex or
don't do anything at all if the vertex is new (and hence no edges in the storage backend).
After that, a map is constructed that maps each vertex to the corresponding VertexCentricQuery and wrapped
into a QueryProcessor. Hence, upon iteration the query will be executed like any other VertexCentricQuery
with the performance difference that the SliceQueries will have already been preloaded and not further
calls to the storage backend are needed.returnType - public Map<TitanVertex,Iterable<? extends TitanRelation>> executeImplicitKeyQuery()
public Map<TitanVertex,Iterable<TitanEdge>> titanEdges()
TitanMultiVertexQuerytitanEdges in interface TitanMultiVertexQuery<MultiVertexCentricQueryBuilder>public Map<TitanVertex,Iterable<TitanProperty>> properties()
TitanMultiVertexQueryproperties in interface TitanMultiVertexQuery<MultiVertexCentricQueryBuilder>public Map<TitanVertex,Iterable<TitanRelation>> relations()
TitanMultiVertexQueryrelations in interface TitanMultiVertexQuery<MultiVertexCentricQueryBuilder>public Map<TitanVertex,Iterable<TitanVertex>> vertices()
TitanMultiVertexQueryvertices in interface TitanMultiVertexQuery<MultiVertexCentricQueryBuilder>public Map<TitanVertex,VertexList> vertexIds()
TitanMultiVertexQueryvertexIds in interface TitanMultiVertexQuery<MultiVertexCentricQueryBuilder>public QueryDescription describeForEdges()
BaseVertexQueryQueryDescription object.
This can be used to inspect the query plan for this query. Note, that calling this method
does not actually execute the query but only optimizes it and constructs a query plan.describeForEdges in interface BaseVertexQuery<MultiVertexCentricQueryBuilder>describeForEdges in class AbstractVertexCentricQueryBuilder<MultiVertexCentricQueryBuilder>public QueryDescription describeForProperties()
BaseVertexQueryQueryDescription object.
This can be used to inspect the query plan for this query. Note, that calling this method
does not actually execute the query but only optimizes it and constructs a query plan.describeForProperties in interface BaseVertexQuery<MultiVertexCentricQueryBuilder>describeForProperties in class AbstractVertexCentricQueryBuilder<MultiVertexCentricQueryBuilder>Copyright © 2012–2014. All rights reserved.