Search in sources :

Example 1 with AndCondition

use of org.apache.atlas.repository.graphdb.titan.query.expr.AndCondition in project incubator-atlas by apache.

the class TitanGraphQuery method vertices.

@Override
public Iterable<AtlasVertex<V, E>> vertices() {
    LOG.debug("Executing: ");
    LOG.debug(queryCondition.toString());
    //compute the overall result by unioning the results from all of the
    //AndConditions together.
    Set<AtlasVertex<V, E>> result = new HashSet<>();
    for (AndCondition andExpr : queryCondition.getAndTerms()) {
        NativeTitanGraphQuery<V, E> andQuery = andExpr.create(getQueryFactory());
        for (AtlasVertex<V, E> vertex : andQuery.vertices()) {
            result.add(vertex);
        }
    }
    return result;
}
Also used : AtlasVertex(org.apache.atlas.repository.graphdb.AtlasVertex) HashSet(java.util.HashSet) AndCondition(org.apache.atlas.repository.graphdb.titan.query.expr.AndCondition)

Aggregations

HashSet (java.util.HashSet)1 AtlasVertex (org.apache.atlas.repository.graphdb.AtlasVertex)1 AndCondition (org.apache.atlas.repository.graphdb.titan.query.expr.AndCondition)1