mirror of
https://github.com/deepseek-ai/3FS.git
synced 2026-11-05 00:47:47 +00:00
[PR #119] Abstract KV layer options to eliminate dynamic casts to FDBTransaction #297
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/3FS#297
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/3FS/pull/119
Author: @Clcanny
Created: 3/6/2025
Status: 🔄 Open
Base:
main← Head:remove-dynamic-cast📝 Commits (1)
47a3ed4Abstract KV layer options to eliminate dynamic casts to FDBTransaction📊 Changes
7 files changed (+51 additions, -9 deletions)
View changed files
📝
src/common/kv/ITransaction.h(+11 -0)📝
src/common/kv/mem/MemTransaction.h(+7 -0)📝
src/fdb/FDBTransaction.cc(+16 -0)📝
src/fdb/FDBTransaction.h(+2 -0)📝
src/meta/components/GcManager.cc(+4 -6)📝
src/meta/store/Operation.h(+2 -3)📝
tests/common/TestWithTransaction.cc(+9 -0)📄 Description
The use of
dynamic_castcan bypass the common functionality defined by the interface classes (IReadOnlyTransactionandIReadWriteTransaction) and instead rely on specific implementation details. This might not be ideal, as it reduces abstraction and increases coupling to a particular implementation. To address this, I attempted to define common option-setting functions.I considered two approaches:
setOption(TransactionOption option, std::string_view value)that can handle all options.enableStaleReadandsetPriority.I chose the second approach because it assumes there are not many options to set, and this method is clearer and type-safe compared to passing raw value strings.
Thank you for taking the time to review. Feel free to close the MR if it is too small or not helpful.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.