Search in sources :

Example 31 with Query

use of com.baidu.hugegraph.backend.query.Query in project incubator-hugegraph by apache.

the class VertexCoreTest method testQueryAllWithLimitByQueryVertices.

@Test
public void testQueryAllWithLimitByQueryVertices() {
    HugeGraph graph = graph();
    this.init10VerticesAndCommit();
    Query query = new Query(HugeType.VERTEX);
    query.limit(1);
    Iterator<Vertex> iter = graph.vertices(query);
    List<Vertex> vertices = IteratorUtils.list(iter);
    Assert.assertEquals(1, vertices.size());
    CloseableIterator.closeIterator(iter);
}
Also used : FakeVertex(com.baidu.hugegraph.testutil.FakeObjects.FakeVertex) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) HugeGraph(com.baidu.hugegraph.HugeGraph) Query(com.baidu.hugegraph.backend.query.Query) ConditionQuery(com.baidu.hugegraph.backend.query.ConditionQuery) Test(org.junit.Test)

Aggregations

Query (com.baidu.hugegraph.backend.query.Query)31 ConditionQuery (com.baidu.hugegraph.backend.query.ConditionQuery)24 Id (com.baidu.hugegraph.backend.id.Id)11 HugeGraph (com.baidu.hugegraph.HugeGraph)9 IdQuery (com.baidu.hugegraph.backend.query.IdQuery)9 HugeType (com.baidu.hugegraph.type.HugeType)7 Iterator (java.util.Iterator)7 Watched (com.baidu.hugegraph.perf.PerfUtil.Watched)6 HugeEdge (com.baidu.hugegraph.structure.HugeEdge)6 HugeVertex (com.baidu.hugegraph.structure.HugeVertex)6 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)6 BackendEntry (com.baidu.hugegraph.backend.store.BackendEntry)5 Edge (org.apache.tinkerpop.gremlin.structure.Edge)5 Test (org.junit.Test)5 HugeException (com.baidu.hugegraph.HugeException)4 BackendException (com.baidu.hugegraph.backend.BackendException)4 GraphTransaction (com.baidu.hugegraph.backend.tx.GraphTransaction)4 ArrayList (java.util.ArrayList)4 IdPrefixQuery (com.baidu.hugegraph.backend.query.IdPrefixQuery)3 IdRangeQuery (com.baidu.hugegraph.backend.query.IdRangeQuery)3