-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bfs optimize vertex-out-out query #1359
Conversation
cassandra: [ERROR] Tests run: 684, Failures: 2, Errors: 0, Skipped: 21, Time elapsed: 481.763 s <<< FAILURE! - in com.baidu.hugegraph.core.CoreTestSuite
[ERROR] testQueryEdgesWithLimitOnMultiLevel(com.baidu.hugegraph.core.EdgeCoreTest) Time elapsed: 0.359 s <<< FAILURE!
java.lang.AssertionError: expected:<4> but was:<3>
at com.baidu.hugegraph.core.EdgeCoreTest.testQueryEdgesWithLimitOnMultiLevel(EdgeCoreTest.java:1999)
[ERROR] testQueryEdgesAdjacentVerticesWithLimitAndFilterProp(com.baidu.hugegraph.core.EdgeCoreTest) Time elapsed: 1.056 s <<< FAILURE!
java.lang.AssertionError: expected:<9> but was:<11>
at com.baidu.hugegraph.core.EdgeCoreTest.testQueryEdgesAdjacentVerticesWithLimitAndFilterProp(EdgeCoreTest.java:2398) mysql: [ERROR] Tests run: 684, Failures: 2, Errors: 0, Skipped: 26, Time elapsed: 314.164 s <<< FAILURE! - in com.baidu.hugegraph.core.CoreTestSuite
[ERROR] testQueryEdgesWithLimitOnMultiLevel(com.baidu.hugegraph.core.EdgeCoreTest) Time elapsed: 0.273 s <<< FAILURE!
java.lang.AssertionError: expected:<4> but was:<3>
at com.baidu.hugegraph.core.EdgeCoreTest.testQueryEdgesWithLimitOnMultiLevel(EdgeCoreTest.java:1999)
[ERROR] testQueryEdgesAdjacentVerticesWithLimitAndFilterProp(com.baidu.hugegraph.core.EdgeCoreTest) Time elapsed: 0.312 s <<< FAILURE!
java.lang.AssertionError: expected:<9> but was:<11>
at com.baidu.hugegraph.core.EdgeCoreTest.testQueryEdgesAdjacentVerticesWithLimitAndFilterProp(EdgeCoreTest.java:2398) rocksdb: [ERROR] Tests run: 684, Failures: 2, Errors: 2, Skipped: 13, Time elapsed: 286.605 s <<< FAILURE! - in com.baidu.hugegraph.core.CoreTestSuite
[ERROR] testQueryEdgesWithLimitOnMultiLevel(com.baidu.hugegraph.core.EdgeCoreTest) Time elapsed: 0.121 s <<< FAILURE!
java.lang.AssertionError: expected:<4> but was:<3>
at com.baidu.hugegraph.core.EdgeCoreTest.testQueryEdgesWithLimitOnMultiLevel(EdgeCoreTest.java:1999)
[ERROR] testQueryEdgesWithLimitOnSuperVertexAndFilterProp(com.baidu.hugegraph.core.EdgeCoreTest) Time elapsed: 0.704 s <<< ERROR!
java.lang.IllegalArgumentException: Too many conditions(10001) each query
at com.baidu.hugegraph.core.EdgeCoreTest.testQueryEdgesWithLimitOnSuperVertexAndFilterProp(EdgeCoreTest.java:2553)
[ERROR] testQueryEdgesAdjacentVerticesWithLimitAndFilterProp(com.baidu.hugegraph.core.EdgeCoreTest) Time elapsed: 0.37 s <<< FAILURE!
java.lang.AssertionError: expected:<9> but was:<11>
at com.baidu.hugegraph.core.EdgeCoreTest.testQueryEdgesAdjacentVerticesWithLimitAndFilterProp(EdgeCoreTest.java:2398)
[ERROR] testReloadAndQueryWithProperty(com.baidu.hugegraph.core.RamTableTest) Time elapsed: 0.258 s <<< ERROR!
java.lang.ClassCastException: java.util.LinkedList cannot be cast to com.baidu.hugegraph.backend.id.Id
at com.baidu.hugegraph.core.RamTableTest.testReloadAndQueryWithProperty(RamTableTest.java:456) |
protected Traverser.Admin<E> processNextStart() { | ||
/* Override super.processNextStart() */ | ||
if (this.parents == null) { | ||
Function<Object, Traverser.Admin<Vertex>> nextFunc = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use java.util.Function
protected Traverser.Admin<E> processNextStart() { | ||
/* Override super.processNextStart() */ | ||
if (this.parents == null) { | ||
Function<Object, Traverser.Admin<Vertex>> nextFunc = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove = null
, it's redudant
} | ||
|
||
// TODO: use BatchMapperIterator | ||
List<Traverser.Admin<Vertex>> vertexes = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace with vertices
|
||
BatchConditionQuery batchQuery = new BatchConditionQuery(HugeType.EDGE); | ||
|
||
for (Traverser.Admin<Vertex> t : traversers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t -> traverser
72e1556
to
35a306d
Compare
35a306d
to
4f1327d
Compare
} else { | ||
E.checkArgument(this.in.key().equals(key), | ||
"Invalid key '%s'", key); | ||
E.checkArgument(keysEquals(query), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add this
|
||
public void mergeToIN(ConditionQuery query, HugeKeys key) { | ||
Object value = query.condition(key); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove empty line
continue; | ||
} | ||
Object key = r.key(); | ||
if (!keys.contains(key)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!keys.contains(key)) {
}
seems unnecessary, keys and key are both from this.relations()
} | ||
} | ||
|
||
protected boolean keysEquals(ConditionQuery query) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method name can be better, because it compared both keys and values
Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label |
Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label |
Change-Id: I1b3c2e942cbfdc9f51cfc43a3ff5aa61b62e22d0
Change-Id: I4e53af1bc276a892c6d0d59985f925a4e7fb775b
Change-Id: I5966568d023413a692667db212c398d795aaf714
Change-Id: Ief8e5ab3d2e50ecabb03c63e515eabe4d08252d6
Change-Id: I52ee68642b03127ac498aa8a32254c0999ff73d3
Change-Id: Ie2104984bfe8402187119876be47a102663996ea
Change-Id: Ibef23b66de60d901502b8cf5b836da3cb9e3c22c
Change-Id: I7366d240fb762fdb9ca36c60344c3082586fd24c
Change-Id: I92d01e9beb699e4585e03b8e8392c8d65138d939
Change-Id: I9334d87b55deefca1963403697beb8aef246c30a
Change-Id: Ie003fc8e1a5fa3befac78afe777830370b246aad
…OOM) Change-Id: I34fe7bd6c37d93d2743978e8a5b7b54871044a49
Change-Id: Ie6f9a9ece555b908ef2004dca1440e613a138ca9
Change-Id: I56435b4f512826b0c40dc93317e8f6096bc9c45b
20055fe
to
bd83132
Compare
Codecov Report
@@ Coverage Diff @@
## master #1359 +/- ##
============================================
- Coverage 63.26% 63.24% -0.03%
- Complexity 6703 6759 +56
============================================
Files 418 421 +3
Lines 34454 34642 +188
Branches 4764 4797 +33
============================================
+ Hits 21799 21910 +111
- Misses 10407 10459 +52
- Partials 2248 2273 +25
Continue to review full report at Codecov.
|
cassandra: Error: Failures:
Error: EdgeCoreTest.testQueryEdgesAdjacentVerticesWithLimitAndFilterProp:2398 expected:<9> but was:<11>
Error: EdgeCoreTest.testQueryEdgesWithLimitOnMultiLevel:1999 expected:<4> but was:<3>
[INFO]
Error: Tests run: 713, Failures: 2, Errors: 0, Skipped: 21
scylladb: com.baidu.hugegraph.core.EdgeCoreTest.testQueryEdgesWithLimitOnSuperVertexAndFilterProp(EdgeCoreTest.java:2553)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.ServerError:
An unexpected error occurred server side on /127.0.0.1:9042: partition key cartesian product size 1000 is greater than maximum 100)) |
Change-Id: I5bd87d3dd4210568fe84c4d7154d6db5e0dea0a0
Change-Id: I77083eed68a77d385f03321ec267821fd4cc0c31
|
||
private static final long serialVersionUID = -3609787815053052222L; | ||
|
||
private final int batchSize = (int) Query.QUERY_BATCH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single usage can be move to line 61? after if (this.batchIterator == null) {
if (queryVertex) { | ||
this.iterator = (Iterator<E>) this.vertices(traversers); | ||
} else { | ||
assert queryEdge; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems same with line 105
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's just for comment
Change-Id: I2fa0849c16757a6a02959e797385570d0f6876d2
No description provided.