imbajin commented on code in PR #349:
URL:
https://github.com/apache/hugegraph-computer/pull/349#discussion_r3450077708
##########
computer/computer-core/src/main/java/org/apache/hugegraph/computer/core/input/HugeConverter.java:
##########
@@ -96,4 +104,27 @@ public static Properties convertProperties(
}
return properties;
}
+
+ public static String convertEdgeName(Edge edge) {
+ E.checkArgumentNotNull(edge, "The edge can't be null");
+ String edgeId = edge.id();
+ if (edgeId == null) {
+ return edge.name();
+ }
+
+ String[] parts = SplicingIdGenerator.split(edgeId);
+ if (parts.length == LEGACY_EDGE_ID_PARTS) {
+ return edge.name();
Review Comment:
⚠️ **Keep legacy id parsing inside the shim**
`convertEdgeName()` already splits the id, but the 4-part branch still
delegates to `edge.name()`. That only works with the current `hugegraph-client`
1.3.0 dependency; the current java-client implementation only accepts 5/6-part
ids and derives the name from `idParts[idParts.length - 2]`, so this
compatibility shim will break for legacy ids when the client dependency is
aligned with the 1.7.0 runtime that this PR now validates against.
Please return `parts[2]` for `LEGACY_EDGE_ID_PARTS` directly, or use the
shared `parts[parts.length - 2]` invariant for all accepted arities, and leave
`edge.name()` only for null or unknown formats.
--
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]