imbajin commented on code in PR #2982:
URL: https://github.com/apache/hugegraph/pull/2982#discussion_r3141690892
##########
hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/RocksDBTable.java:
##########
@@ -209,6 +210,10 @@ protected BackendColumnIterator
queryByIds(RocksDBSessions.Session session,
return this.queryById(session, ids.iterator().next());
}
Review Comment:
‼️ 这里把 `getByIds()` 放到 `RocksDBTable` 父类会改变非 Vertex/Edge 表的查询语义。父类
`queryById()` 仍然使用 `session.scan(table, id.asBytes())`,并且注释里说明 vertex/schema
目前还不能统一改成 point get;但这个分支会让所有未 override `queryByIds()` 的 RocksDB table 在多 id
查询时改走 exact multi-get。
这对 `Vertex` / `Edge` 是合理的,因为它们的 `queryById()` 已经是 `getById()`;但 schema/index
等表原本依赖 prefix scan,放在父类可能导致多 id 查询查不到本应返回的列。建议父类保留旧的 scan-based 实现,把 multi-get
下沉到 `Vertex` / `Edge` 的 override 中。
```suggestion
// NOTE: this will lead to lazy create rocksdb iterator
return BackendColumnIterator.wrap(new FlatMapperIterator<>(
ids.iterator(), id -> this.queryById(session, id)
));
```
然后在 `RocksDBTables.Vertex` / `RocksDBTables.Edge` 中分别 override
`queryByIds()`,仅在 `!session.hasChanges()` 时调用 `getByIds()`。
--
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]