[PR #1121] [MERGED] [store] add pybind for get_replica_desc #2023

Closed
opened 2026-10-29 21:32:11 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/1121
Author: @yejj710
Created: 11/26/2025
Status: ✅ Merged
Merged: 12/4/2025
Merged by: @stmatengss

Base: main ← Head: pybind_interface


📝 Commits (3)

  • 9c0e0f3 add pybind for get_replica
  • e9464ee rename pybinb funcs name & update api doc
  • e887b2d fix spell problem

📊 Changes

8 files changed (+266 additions, -3 deletions)

View changed files

📝 docs/source/python-api-reference/mooncake-store.md (+57 -0)
📝 mooncake-integration/store/store_py.cpp (+68 -1)
📝 mooncake-store/include/dummy_client.h (+4 -0)
📝 mooncake-store/include/pyclient.h (+5 -0)
📝 mooncake-store/include/real_client.h (+4 -0)
📝 mooncake-store/src/dummy_client.cpp (+31 -0)
📝 mooncake-store/src/real_client.cpp (+48 -2)
📝 mooncake-store/tests/pybind_client_test.cpp (+49 -0)

📄 Description

Description

  • There is a Query funcs in client_service.cpp, which providing query replica_descriptor ability. But I haven't seen a pybind interface that provides this implementation.
    And I want to query replica_descriptor to do some cache aware route, so i implement it.

Type of Change

  • Types
    • Bug fix
    • New feature
      • Transfer Engine
      • Mooncake Store
      • Mooncake EP
      • Integration
      • P2P Store
      • Python Wheel
    • Breaking change
    • CI/CD
    • Documentation update
    • Other

How Has This Been Tested?

from mooncake.store import MooncakeDistributedStore
store_client = MooncakeDistributedStore()
store_client .setup() # add init config
descriptors = store.get_replica_desc("mooncake_key")
for desc in descriptors:
    print("Status:", desc.status)
    if desc.is_memory_replica():
        mem_desc = desc.get_memory_descriptor()
        print("Memory buffer desc:", mem_desc.buffer_descriptor)
    elif desc.is_disk_replica():
        disk_desc = desc.get_disk_descriptor()
        print("Disk path:", disk_desc.file_path, "Size:", disk_desc.object_size)

Checklist

  • I have performed a self-review of my own code.
  • I have updated the documentation.
  • I have added tests to prove my changes are effective.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/Mooncake/pull/1121 **Author:** [@yejj710](https://github.com/yejj710) **Created:** 11/26/2025 **Status:** ✅ Merged **Merged:** 12/4/2025 **Merged by:** [@stmatengss](https://github.com/stmatengss) **Base:** `main` ← **Head:** `pybind_interface` --- ### 📝 Commits (3) - [`9c0e0f3`](https://github.com/kvcache-ai/Mooncake/commit/9c0e0f3021431dfb6e870e88293baa61be450c80) add pybind for get_replica - [`e9464ee`](https://github.com/kvcache-ai/Mooncake/commit/e9464eef95a533bcd9a4f67360adf3e9c1b3c4b0) rename pybinb funcs name & update api doc - [`e887b2d`](https://github.com/kvcache-ai/Mooncake/commit/e887b2d7c621eaa162f81c93aba6cdc07d14f04a) fix spell problem ### 📊 Changes **8 files changed** (+266 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/source/python-api-reference/mooncake-store.md` (+57 -0) 📝 `mooncake-integration/store/store_py.cpp` (+68 -1) 📝 `mooncake-store/include/dummy_client.h` (+4 -0) 📝 `mooncake-store/include/pyclient.h` (+5 -0) 📝 `mooncake-store/include/real_client.h` (+4 -0) 📝 `mooncake-store/src/dummy_client.cpp` (+31 -0) 📝 `mooncake-store/src/real_client.cpp` (+48 -2) 📝 `mooncake-store/tests/pybind_client_test.cpp` (+49 -0) </details> ### 📄 Description ## Description * There is a `Query` funcs in `client_service.cpp`, which providing query replica_descriptor ability. But I haven't seen a pybind interface that provides this implementation. And I want to query replica_descriptor to do some cache aware route, so i implement it. ## Type of Change * Types - [ ] Bug fix - [ ] New feature - [ ] Transfer Engine - [x] Mooncake Store - [ ] Mooncake EP - [x] Integration - [ ] P2P Store - [ ] Python Wheel - [ ] Breaking change - [ ] CI/CD - [ ] Documentation update - [ ] Other ## How Has This Been Tested? ```python from mooncake.store import MooncakeDistributedStore store_client = MooncakeDistributedStore() store_client .setup() # add init config descriptors = store.get_replica_desc("mooncake_key") for desc in descriptors: print("Status:", desc.status) if desc.is_memory_replica(): mem_desc = desc.get_memory_descriptor() print("Memory buffer desc:", mem_desc.buffer_descriptor) elif desc.is_disk_replica(): disk_desc = desc.get_disk_descriptor() print("Disk path:", disk_desc.file_path, "Size:", disk_desc.object_size) ``` ## Checklist - [x] I have performed a self-review of my own code. - [x] I have updated the documentation. - [x] I have added tests to prove my changes are effective. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:32:11 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#2023
No description provided.