Skip to content

Commit

Permalink
improve test: add mayCommitTx()
Browse files Browse the repository at this point in the history
Change-Id: Iefc59747a2cb300a927a48c68a79d4988bc30b12
  • Loading branch information
javeme committed Apr 1, 2022
1 parent 6a6d99c commit f293145
Show file tree
Hide file tree
Showing 3 changed files with 357 additions and 241 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,16 @@ public Iterator<Vertex> queryVertices() {
}

public Iterator<Vertex> queryVertices(Query query) {
E.checkArgument(this.removedVertices.isEmpty() || query.noLimit(),
"It's not allowed to query with limit when " +
"there are uncommitted delete records.");
if (this.hasUpdate()) {
E.checkArgument(this.removedVertices.isEmpty() ||
query.noLimitAndOffset(),
"It's not allowed to query with offser/limit " +
"when there are uncommitted delete records.");
// TODO: also add check: no SCAN, no OLAP
E.checkArgument(!query.paging(),
"It's not allowed to query by paging when " +
"there are uncommitted records.");
}

query.resetActualOffset();

Expand Down Expand Up @@ -935,9 +942,16 @@ public Iterator<Edge> queryEdges() {

@Watched
public Iterator<Edge> queryEdges(Query query) {
E.checkArgument(this.removedEdges.isEmpty() || query.noLimit(),
"It's not allowed to query with limit when " +
"there are uncommitted delete records.");
if (this.hasUpdate()) {
E.checkArgument(this.removedEdges.isEmpty() ||
query.noLimitAndOffset(),
"It's not allowed to query with offser/limit " +
"when there are uncommitted delete records.");
// TODO: also add check: no SCAN, no OLAP
E.checkArgument(!query.paging(),
"It's not allowed to query by paging when " +
"there are uncommitted records.");
}

query.resetActualOffset();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ protected void mayCommitTx() {
}
}

protected void commitTx() {
graph().tx().commit();
}

protected BackendFeatures storeFeatures() {
return graph().backendStoreFeatures();
}
Expand Down
Loading

0 comments on commit f293145

Please sign in to comment.