javeme commented on code in PR #544:
URL: 
https://github.com/apache/incubator-hugegraph-toolchain/pull/544#discussion_r1413010429


##########
hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/EdgeExistenceAPI.java:
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hugegraph.api.traverser;
+
+
+import org.apache.hugegraph.api.graph.GraphAPI;
+import org.apache.hugegraph.client.RestClient;
+import org.apache.hugegraph.rest.RestResult;
+import org.apache.hugegraph.structure.graph.Edge;
+import org.apache.logging.log4j.util.Strings;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+public class EdgeExistenceAPI extends TraversersAPI {
+
+    public EdgeExistenceAPI(RestClient client, String graph) {
+        super(client, graph);
+    }
+
+    @Override
+    protected String type() {
+        return "edgeexistence";
+    }
+
+    public List<Edge> get(Object sourceId, Object targetId, String edgeLabel,
+                          String sortValues, Long limit) {

Review Comment:
   also change to `int limit` like other APIs?



##########
hugegraph-client/src/test/java/org/apache/hugegraph/api/traverser/EdgeExistenceAPITest.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hugegraph.api.traverser;
+
+
+import org.apache.hugegraph.api.BaseApiTest;
+import org.apache.hugegraph.structure.graph.Edge;
+import org.apache.hugegraph.testutil.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.List;
+
+public class EdgeExistenceAPITest extends TraverserApiTest{
+
+    @BeforeClass
+    public static void prepareSchemaAndGraph() {
+        BaseApiTest.initPropertyKey();
+        BaseApiTest.initVertexLabel();
+        BaseApiTest.initEdgeLabel();
+        BaseApiTest.initIndexLabel();
+        BaseApiTest.initVertex();
+        BaseApiTest.initEdge();
+    }
+
+    @Test
+    public void testEdgeExistenceGet() {
+        Object markoId = getVertexId("person", "name", "marko");
+        Object vadasId = getVertexId("person", "name", "vadas");
+
+        List<Edge> edges = edgeExistenceAPI.get(markoId, vadasId,
+                                      "knows", "", 100L);

Review Comment:
   align with "markoId"



##########
hugegraph-client/src/main/java/org/apache/hugegraph/driver/TraverserManager.java:
##########
@@ -538,4 +541,16 @@ public Iterator<Edge> iteratorEdges(Shard shard, int 
sizePerPage) {
             return this.edges(shard, page, sizePerPage);
         });
     }
+
+    public List<Edge> edgeExistence(Object sourceId, Object targetId, String 
edgeLabel,
+                                    String sortValues, int limit){
+        return this.edgeExistenceAPI.get(sourceId, targetId, edgeLabel, 
sortValues, (long) limit);

Review Comment:
   can we also keep `int limit` call?



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