javeme commented on code in PR #2295:
URL:
https://github.com/apache/incubator-hugegraph/pull/2295#discussion_r1320679346
##########
hugegraph-api/src/main/java/org/apache/hugegraph/api/traversers/KoutAPI.java:
##########
@@ -228,16 +237,19 @@ private static class Request {
public boolean withPath = false;
@JsonProperty("with_edge")
public boolean withEdge = false;
+ @JsonProperty("algorithm")
Review Comment:
please also update to traverse_mode?
##########
hugegraph-api/src/main/java/org/apache/hugegraph/api/traversers/KoutAPI.java:
##########
@@ -228,16 +237,19 @@ private static class Request {
public boolean withPath = false;
@JsonProperty("with_edge")
public boolean withEdge = false;
+ @JsonProperty("algorithm")
+ public String algorithm = HugeTraverser.TRAVERSE_MODE_BFS;
Review Comment:
ditto
##########
hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/HugeTraverser.java:
##########
@@ -164,6 +171,17 @@ public static void checkSkipDegree(long skipDegree, long
degree,
}
}
+ public static void checkTraverseMode(String traverseMode) {
+ E.checkArgument(traverseMode.compareToIgnoreCase(TRAVERSE_MODE_BFS) ==
0 ||
+ traverseMode.compareToIgnoreCase(TRAVERSE_MODE_DFS) ==
0,
+ "The traverse mode must be one of '%s' or '%s', but
got '%s'",
+ TRAVERSE_MODE_BFS, TRAVERSE_MODE_DFS, traverseMode);
+ }
+
+ public static boolean isTraverseModeDFS(String algorithm) {
Review Comment:
ditto
##########
hugegraph-api/src/main/java/org/apache/hugegraph/api/traversers/KoutAPI.java:
##########
@@ -228,16 +237,19 @@ private static class Request {
public boolean withPath = false;
@JsonProperty("with_edge")
public boolean withEdge = false;
+ @JsonProperty("algorithm")
+ public String algorithm = HugeTraverser.TRAVERSE_MODE_BFS;
@Override
public String toString() {
- return String.format("KoutRequest{source=%s,step=%s,maxDepth=%s" +
+ return String.format("KoutRequest{source=%s,steps=%s,maxDepth=%s" +
"nearest=%s,countOnly=%s,capacity=%s," +
"limit=%s,withVertex=%s,withPath=%s," +
- "withEdge=%s}", this.source, this.step,
- this.maxDepth, this.nearest, this.countOnly,
- this.capacity, this.limit, this.withVertex,
- this.withPath, this.withEdge);
+ "withEdge=%s,algorithm=%s}", this.source,
Review Comment:
ditto
##########
hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/HugeTraverser.java:
##########
@@ -85,6 +89,9 @@ public class HugeTraverser {
// Empirical value of scan limit, with which results can be returned in 3s
public static final String DEFAULT_PAGE_LIMIT = "100000";
public static final long NO_LIMIT = -1L;
+ // kout traverse mode algorithms: bfs and dfs
Review Comment:
"traverse mode of kout algorithm: bfs and dfs"
--
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]