javeme commented on code in PR #2863:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2863#discussion_r2328691178


##########
hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/RocksDBStore.java:
##########
@@ -813,12 +776,56 @@ private void closeSessions() {
         }
     }
 
-    private Collection<RocksDBSessions> sessions() {
+    private final Collection<RocksDBSessions> sessions() {
         return this.dbs.values();
     }
 
-    private void parseTableDiskMapping(Map<String, String> disks, String 
dataPath) {
+    private final List<RocksDBSessions.Session> session() {
+        this.checkDbOpened();
+
+        // Collect session of standard disk
+        RocksDBSessions.Session session = this.sessions.session();
+        if (!session.opened()) {
+            this.checkOpened();
+        }
+
+        if (this.tableDiskMapping.isEmpty()) {
+            return ImmutableList.of(session);
+        }
 
+        // Collect session of each table with optimized disk
+        List<RocksDBSessions.Session> list = new 
ArrayList<>(this.tableDiskMapping.size() + 1);
+        list.add(session);
+        for (String disk : this.tableDiskMapping.values()) {
+            RocksDBSessions.Session optimizedSession = this.db(disk).session();
+            assert optimizedSession.opened();

Review Comment:
   It is believed here that optimizedSession must be the opened state, 
otherwise it is a bug in logic. We consider this optimizedSession state to be 
consistent with the main session state.



-- 
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: issues-unsubscr...@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@hugegraph.apache.org
For additional commands, e-mail: issues-h...@hugegraph.apache.org

Reply via email to