Skip to content

multi-get: expose rocksdb multi-get api do batch get#846

Open
zhangjinpeng87 wants to merge 1 commit intotikv:masterfrom
zhangjinpeng87:multi-get
Open

multi-get: expose rocksdb multi-get api do batch get#846
zhangjinpeng87 wants to merge 1 commit intotikv:masterfrom
zhangjinpeng87:multi-get

Conversation

@zhangjinpeng87
Copy link
Member

@zhangjinpeng87 zhangjinpeng87 commented Feb 11, 2026

Expose rocksdb's multi-get interface to do batch get.

Summary by CodeRabbit

  • New Features
    • Added multi-key batch retrieval functionality enabling efficient fetching of multiple values in a single operation.
    • Support for bulk retrieval across column families with fine-grained error handling for individual keys.
    • New API methods provide streamlined access to multiple key-value pairs with per-key result status.

Signed-off-by: zhangjinpeng87 <zzzhangjinpeng@gmail.com>
@ti-chi-bot ti-chi-bot bot added the dco-signoff: yes Indicates the PR's author has signed the dco. label Feb 11, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 11, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zhouqiang-cl for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 11, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

This pull request adds batch retrieval (multi-get) functionality to RocksDB Rust bindings. New FFI functions crocksdb_multi_get and crocksdb_multi_get_cf are introduced for handling multiple keys in a single call. Corresponding Rust wrapper methods are implemented on DB and Snapshot types to expose ergonomic APIs for bulk key retrieval operations with proper error handling and memory management.

Changes

Cohort / File(s) Summary
FFI Bindings
librocksdb_sys/src/lib.rs
Two new extern "C" functions added: crocksdb_multi_get (batch retrieval without column families) and crocksdb_multi_get_cf (batch retrieval with column families). Both accept arrays of keys and return arrays of values with per-key error handling.
Rust API Wrappers
src/rocksdb.rs
Multi-get methods added to Snapshot<D> (multi_get, multi_get_cf). Four methods added/updated in DB impl (multi_get_opt, multi_get, multi_get_cf_opt, multi_get_cf). Internal helper build_multi_get_result marshals FFI outputs into Rust Result types and manages memory cleanup.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 whiskers twitch with joy
Batch gets hopping without delay,
Multi-keys retrieved in a single way,
Snapshots and databases aligned,
Efficiency gains of every kind! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: exposing RocksDB's multi-get API for batch retrieval operations, which aligns with the additions of multi_get and multi_get_cf functions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the dco. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant