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


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/ConditionQuery.java:
##########
@@ -537,6 +537,23 @@ public ConditionQuery copyAndResetUnshared() {
         return query;
     }
 
+    public Condition.Relation copyRelation(Object key) {

Review Comment:
   prefer copyRelationAndUpdateQuery



##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/Condition.java:
##########
@@ -565,6 +565,10 @@ public Object value() {
             return this.value;
         }
 
+        public void setValue(Object value) {

Review Comment:
   prefer `value(Object value)` style



##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/graph/EdgeAPI.java:
##########
@@ -291,6 +291,19 @@ public String list(@Context GraphManager manager,
         HugeGraph g = graph(manager, graph);
 
         GraphTraversal<?, Edge> traversal;
+
+        // Optimize edge query. Return early when the EdgeLabel does not exist.
+        if (label != null && !g.existsEdgeLabel(label)) {
+            try {
+                traversal = g.traversal().E().limit(0);
+                return manager.serializer(g).writeEdges(traversal, page != 
null);
+            } finally {
+                if (g.tx().isOpen()) {
+                    g.tx().close();
+                }
+            }
+        }
+

Review Comment:
   we can revert this code now.
   This code is the scenario of query-edges(not adjacent-edges) with 
non-exist-label , NOTE we don't need to optimize query-vertices/edges with 
non-exist-label, see schema.SchemaLabel.getLabelId().



-- 
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