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


##########
hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java:
##########
@@ -1574,14 +1597,14 @@ private void checkNonnullProperty(HugeVertex vertex) {
         // Check whether passed all non-null property
         @SuppressWarnings("unchecked")
         Collection<Id> nonNullKeys = CollectionUtils.subtract(
-                                     vertexLabel.properties(),
-                                     vertexLabel.nullableKeys());
+                vertexLabel.properties(),
+                vertexLabel.nullableKeys());

Review Comment:
   can we keep the origin code style



##########
hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/HugeTraverser.java:
##########
@@ -438,6 +465,92 @@ private Iterator<Edge> edgesOfVertex(Id source, EdgeStep 
edgeStep,
         return edgeStep.skipSuperNodeIfNeeded(edges);
     }
 
+    protected Iterator<Edge> edgesOfVertex(Id source, Steps steps) {
+        List<Id> edgeLabels = steps.edgeLabels();
+        ConditionQuery cq = GraphTransaction.constructEdgesQuery(
+                source, steps.direction(), edgeLabels);
+        cq.capacity(Query.NO_CAPACITY);
+        if (steps.limit() != NO_LIMIT) {
+            cq.limit(steps.limit());
+        }
+
+        Map<Id, ConditionQuery> edgeConditions =
+                getElementFilterQuery(steps.edgeSteps(), HugeType.EDGE);
+
+        Iterator<Edge> filteredEdges =
+                new FilterIterator<>(this.graph().edges(cq),
+                                     edge -> validateEdge(edgeConditions, 
(HugeEdge) edge));
+
+        return edgesOfVertexStep(filteredEdges, steps);
+    }
+
+    protected Iterator<Edge> edgesOfVertexStep(Iterator<Edge> edges, Steps 
steps) {
+        if (steps.isVertexEmpty()) {
+            return edges;
+        }
+
+        Map<Id, ConditionQuery> vertexConditions =
+                getElementFilterQuery(steps.vertexSteps(), HugeType.VERTEX);
+
+        return new FilterIterator<>(edges,
+                                    edge -> validateVertex(vertexConditions, 
(HugeEdge) edge));
+    }
+
+    private Boolean validateVertex(Map<Id, ConditionQuery> vConditions,

Review Comment:
   rename vConditions to conditions?



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