Skip to content

Commit

Permalink
fix degree limit lost
Browse files Browse the repository at this point in the history
Change-Id: I9829eacea9e8598a4475b39bd9699ea951de6a97
  • Loading branch information
Linary committed Apr 17, 2019
1 parent 37ffcfd commit 66af119
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public IdPrefixQuery(HugeType resultType, Query originQuery,
this.start = start;
this.inclusiveStart = inclusive;
this.prefix = prefix;
this.copyBasic(originQuery);
}

public Id start() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public IdRangeQuery(HugeType resultType, Query originQuery,
this.end = end;
this.inclusiveStart = inclusiveStart;
this.inclusiveEnd = inclusiveEnd;
this.copyBasic(originQuery);
}

public Id start() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ public Query(HugeType resultType, Query originQuery) {
this.showDeleting = false;
}

public void copyBasic(Query query) {
this.offset = query.offset();
this.limit = query.limit();
this.page = query.page();
this.capacity = query.capacity();
this.showHidden = query.showHidden();
this.showDeleting = query.showDeleting();
}

public HugeType resultType() {
return this.resultType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,6 @@ private Query writeStringIndexQuery(ConditionQuery query) {
} else {
newQuery = new IdPrefixQuery(query, prefix);
}
newQuery.page(query.page());
newQuery.limit(query.limit());
newQuery.offset(query.offset());
return newQuery;
}

Expand Down Expand Up @@ -707,11 +704,7 @@ private Query writeRangeIndexQuery(ConditionQuery query) {
HugeType type = query.resultType();
if (keyEq != null) {
Id id = formatIndexId(type, index, keyEq);
Query newQuery = new IdPrefixQuery(query, id);
newQuery.page(query.page());
newQuery.limit(query.limit());
newQuery.offset(query.offset());
return newQuery;
return new IdPrefixQuery(query, id);
}

if (keyMin == null) {
Expand Down Expand Up @@ -754,9 +747,6 @@ private Query writeRangeIndexQuery(ConditionQuery query) {
}
newQuery = new IdRangeQuery(query, start, keyMinEq, max, keyMaxEq);
}
newQuery.page(query.page());
newQuery.limit(query.limit());
newQuery.offset(query.offset());
return newQuery;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ protected Iterator<Edge> edgesOfVertex(Id source, Directions dir,
ExtendableIterator<Edge> results = new ExtendableIterator<>();
for (Id label : labels) {
E.checkNotNull(label, "edge label");
// TODO: limit should be applied to all labels
results.extend(this.edgesOfVertex(source, dir, label, limit));
}
return results;
Expand Down

0 comments on commit 66af119

Please sign in to comment.