imbajin commented on code in PR #683:
URL:
https://github.com/apache/incubator-hugegraph-toolchain/pull/683#discussion_r2444646571
##########
hugegraph-loader/src/main/java/org/apache/hugegraph/loader/HugeGraphLoader.java:
##########
@@ -153,11 +272,286 @@ private void createSchema() {
throw new LoadException("Failed to read schema file '%s'", e,
options.schema);
}
- groovyExecutor.execute(script, client);
+
+ if (!options.shorterIDConfigs.isEmpty()) {
+ for (ShortIdConfig config : options.shorterIDConfigs) {
+ PropertyKey propertyKey =
client.schema().propertyKey(config.getIdFieldName())
+ .ifNotExist()
+
.dataType(config.getIdFieldType())
+ .build();
+ client.schema().addPropertyKey(propertyKey);
+ }
+ groovyExecutor.execute(script, client);
+ List<VertexLabel> vertexLabels =
client.schema().getVertexLabels();
+ for (VertexLabel vertexLabel : vertexLabels) {
Review Comment:
**Resource Leak Risk**: The `HugeClient sourceClient` is created but may not
be properly closed if an exception occurs during vertex/edge/index label
creation. Consider using try-with-resources for all client creation or ensure
proper cleanup in finally blocks.
--
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]