Commit ee64377 1 parent 433fda3 commit ee64377 Copy full SHA for ee64377
File tree 3 files changed +11
-8
lines changed
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph
3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -553,7 +553,7 @@ public Condition.Relation copyRelationAndUpdateQuery(Object key) {
553
553
}
554
554
}
555
555
}
556
- E .checkArgument (copyRes != null , "Copying Condition.Relation failed. key: %s" , key );
556
+ E .checkArgument (copyRes != null , "Failed to copy Condition.Relation: %s" , key );
557
557
return copyRes ;
558
558
}
559
559
Original file line number Diff line number Diff line change @@ -1460,7 +1460,7 @@ private Query optimizeQuery(ConditionQuery query) {
1460
1460
List <Id > filterVertexList = vertexIdList .stream ().filter (vertexId -> {
1461
1461
Vertex vertex = this .graph ().vertex (vertexId );
1462
1462
VertexLabel vertexLabel = graph ().vertexLabel (vertex .label ());
1463
- return edgeLabel .linkWithLabel (vertexLabel .id (), dir . type () );
1463
+ return edgeLabel .linkWithVertexLabel (vertexLabel .id (), dir );
1464
1464
}).collect (Collectors .toList ());
1465
1465
if (CollectionUtils .isEmpty (filterVertexList )) {
1466
1466
// Return empty query to skip storage query
@@ -1477,7 +1477,7 @@ private Query optimizeQuery(ConditionQuery query) {
1477
1477
Vertex vertex = QueryResults .one (iter );
1478
1478
if (vertex != null ) {
1479
1479
VertexLabel vertexLabel = graph ().vertexLabel (vertex .label ());
1480
- if (!edgeLabel .linkWithLabel (vertexLabel .id (), dir . type () )) {
1480
+ if (!edgeLabel .linkWithVertexLabel (vertexLabel .id (), dir )) {
1481
1481
// Return empty query to skip storage query
1482
1482
return new Query (query .resultType ());
1483
1483
}
Original file line number Diff line number Diff line change 27
27
import org .apache .hugegraph .backend .id .Id ;
28
28
import org .apache .hugegraph .schema .builder .SchemaBuilder ;
29
29
import org .apache .hugegraph .type .HugeType ;
30
+ import org .apache .hugegraph .type .define .Directions ;
30
31
import org .apache .hugegraph .type .define .Frequency ;
31
32
import org .apache .hugegraph .util .E ;
32
33
@@ -99,11 +100,13 @@ public boolean linkWithLabel(Id id) {
99
100
return this .sourceLabel .equals (id ) || this .targetLabel .equals (id );
100
101
}
101
102
102
- public boolean linkWithLabel (Id id , HugeType type ) {
103
- if (type .equals (HugeType .EDGE_IN )) {
104
- return this .targetLabel .equals (id );
105
- } else if (type .equals (HugeType .EDGE_OUT )) {
106
- return this .sourceLabel .equals (id );
103
+ public boolean linkWithVertexLabel (Id label , Directions dir ) {
104
+ if (dir .equals (Directions .IN )) {
105
+ return this .targetLabel .equals (label );
106
+ } else if (dir .equals (Directions .OUT )) {
107
+ return this .sourceLabel .equals (label );
108
+ } else if (dir .equals (Directions .BOTH )) {
109
+ return this .targetLabel .equals (label ) || this .sourceLabel .equals (label );
107
110
}
108
111
return false ;
109
112
}
You can’t perform that action at this time.
0 commit comments