Skip to content

Commit

Permalink
Throw exception if exceeds 80w without paging
Browse files Browse the repository at this point in the history
resolved: #360

Change-Id: I46c7a61df21d6902aba6c0c965e8f63aa3b76fe2
  • Loading branch information
zhoney committed Mar 28, 2019
1 parent 60d8d8f commit e2db3e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@ public String scan(@Context GraphManager manager,

ConditionQuery query = new ConditionQuery(HugeType.EDGE_OUT);
query.scan(start, end);
query.limit(Query.DEFAULT_CAPACITY);
query.page(page);
boolean paging = page != null;
if (paging) {
query.limit(Query.DEFAULT_CAPACITY);
}
Iterator<Edge> edges = g.edges(query);

return manager.serializer(g).writeEdges(edges, true);
return manager.serializer(g).writeEdges(edges, paging);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@ public String scan(@Context GraphManager manager,

ConditionQuery query = new ConditionQuery(HugeType.VERTEX);
query.scan(start, end);
query.limit(Query.DEFAULT_CAPACITY);
query.page(page);
boolean paging = page != null;
if (paging) {
query.limit(Query.DEFAULT_CAPACITY);
}
Iterator<Vertex> vertices = g.vertices(query);

return manager.serializer(g).writeVertices(vertices, true);
return manager.serializer(g).writeVertices(vertices, paging);
}
}

0 comments on commit e2db3e5

Please sign in to comment.