vaijosh commented on code in PR #3081:
URL: https://github.com/apache/hugegraph/pull/3081#discussion_r3631830779


##########
hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/AppConfig.java:
##########
@@ -116,6 +145,119 @@ public void init() {
             "0".equals(rocksdb.get("write_buffer_size"))) {
             rocksdb.put("write_buffer_size", Long.toString(totalMemory / 
1000));
         }
+
+        // ---- Cloud storage initialization ----
+        initCloudStorage();
+    }
+
+    /**
+     * Initialises the cloud storage provider (if enabled) and registers
+     * {@link CloudStorageEventListener} with {@link RocksDBFactory} so that
+     * SST file creation/deletion events are forwarded to cloud storage.
+     *
+     * <p>The resolved absolute data-path is passed to the listener so that
+     * S3 object keys are relative to the store's storage root rather than
+     * being full container-specific absolute paths.
+     */
+    private void initCloudStorage() {
+        CloudStorageConfig cfg = 
cloudStorageSpringConfig.toCloudStorageConfig();
+        if (!cfg.isEnabled()) {
+            log.info("Cloud storage disabled (cloud.storage.enabled=false)");
+            return;
+        }
+        try {
+            CloudStorageProviderFactory.initialize(cfg);
+            String resolvedDataRoot =
+                    
Paths.get(dataPath).toAbsolutePath().normalize().toString();

Review Comment:
   Addressed



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