imbajin commented on code in PR #815:
URL: 
https://github.com/apache/hugegraph-toolchain/pull/815#discussion_r4274194162


##########
hugegraph-loader/README.md:
##########
@@ -171,3 +171,67 @@ Server 1.7 compatibility CI uses the pinned official ASF 
1.7.0 binary archive. T
 hugegraph-loader is licensed under Apache 2.0 License.
 
 See the [Flink CDC Java 17 validation](docs/flink-cdc-java17.md) for its 
current limits and launcher syntax.
+
+### Concurrent imports and graph mode

Review Comment:
   Moved the ownership and administrator recovery section into Usage 3.1, 
directly after graph-mode startup and cleanup, and added an anchor link from 
that subsection. The Flink CDC link is now under Doc; License contains only the 
license text. Local paths, the anchor, section placement and whitespace checks 
pass.



##########
hugegraph-loader/src/main/java/org/apache/hugegraph/loader/executor/LoadContext.java:
##########
@@ -211,6 +215,29 @@ public void updateSchemaCache() {
     @SneakyThrows
     public synchronized void setLoadingMode() {
         String graph = this.client.graph().graph();
+        if (this.loadingOwnerReleased) {
+            throw new LoadException("Loading owner has already been released; 
create a new context");
+        }
+        if (this.loadingOwner == null) {
+            try {
+                this.loadingOwner = 
this.client.graphs().newLoadingOwner(graph);
+                LOG.info("Preparing LOADING owner {} for graph '{}'; after an 
unclean exit, stop related imports " +
+                         "and use the Server loading-owner recovery 
procedure", this.loadingOwner, graph);
+            } catch (ServerException e) {
+                if (e.status() != 404 || !"HTTP 404 Not 
Found".equals(e.getMessage()) ||
+                    !("jakarta.ws.rs.NotFoundException".equals(e.exception()) 
||
+                      "javax.ws.rs.NotFoundException".equals(e.exception()) ||
+                      "class 
jakarta.ws.rs.NotFoundException".equals(e.exception()) ||
+                      "class 
javax.ws.rs.NotFoundException".equals(e.exception()))) {
+                    throw e;
+                }
+                LOG.warn("Server has no loading-owner endpoint; use legacy 
mode without concurrent-import protection");
+            }
+        }
+        if (this.loadingOwner != null) {
+            this.client.graphs().acquireLoadingOwner(graph, this.loadingOwner);

Review Comment:
   Added the requested README warning immediately before administrator 
recovery: this SDK change alone can leave Hubble owners active after 
completion, stop or reconnect, blocking mode changes including restore. It 
explicitly requires deploying the paired task cleanup #814 and application 
shutdown #818 changes together. Those fixes remain separate PRs; this 
documentation does not claim they have landed or passed final combined 
acceptance.



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