javeme commented on code in PR #2408:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2408#discussion_r1501565528


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/EdgeLabel.java:
##########
@@ -99,6 +99,15 @@ public boolean linkWithLabel(Id id) {
         return this.sourceLabel.equals(id) || this.targetLabel.equals(id);
     }
 
+    public boolean linkWithLabel(Id id, HugeType type) {
+        if (type.equals(HugeType.EDGE_IN)) {
+            return this.targetLabel.equals(id);
+        } else if (type.equals(HugeType.EDGE_OUT)) {
+            return this.sourceLabel.equals(id);
+        }

Review Comment:
   also add case `dir == BOTH`



##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/EdgeLabel.java:
##########
@@ -99,6 +99,15 @@ public boolean linkWithLabel(Id id) {
         return this.sourceLabel.equals(id) || this.targetLabel.equals(id);
     }
 
+    public boolean linkWithLabel(Id id, HugeType type) {

Review Comment:
   prefer `linkWithVertexLabel(Id label, Directions dir)`



##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/ConditionQuery.java:
##########
@@ -540,6 +540,23 @@ public ConditionQuery copyAndResetUnshared() {
         return query;
     }
 
+    public Condition.Relation copyRelationAndUpdateQuery(Object key) {
+        Condition.Relation copyRes = null;
+        for (int i = 0; i < this.conditions.size(); i++) {
+            Condition c = this.conditions.get(i);
+            if (c.isRelation()) {
+                Condition.Relation r = (Condition.Relation) c;
+                if (r.key().equals(key)) {
+                    copyRes = r.copy();
+                    this.conditions.set(i, copyRes);
+                    break;
+                }
+            }
+        }
+        E.checkArgument(copyRes != null, "Copying Condition.Relation failed. 
key:%s", key);

Review Comment:
   prefer "Failed to copy Condition.Relation: %s"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to