-
Notifications
You must be signed in to change notification settings - Fork 388
pass transfer engine to mooncake store to reuse the engine to transfer data #899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Good thought. I have a similar idea but lack the time to implement it. Will review it ASAP. |
/gemini review |
Important Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services. |
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the MooncakeStore
and its underlying Client
to allow reusing an existing TransferEngine
instance. This is achieved by changing the Client
to hold a std::shared_ptr<TransferEngine>
instead of a direct instance, and adding new API overloads in both C++ and Python bindings to accept a pre-initialized engine. The changes are well-implemented and follow the intended goal. I've found one instance of redundant code that can be removed to improve maintainability.
mooncake-store/src/pybind_client.cpp
Outdated
if (transfer_engine && | ||
local_hostname != transfer_engine.value()->getLocalIpAndPort()) { | ||
LOG(ERROR) << "the local_hostname should be consistent with the " | ||
"transfer engine local ip and port. local_hostname is " | ||
<< local_hostname | ||
<< ", but the transfer engine local ip and port is " | ||
<< transfer_engine.value()->getLocalIpAndPort(); | ||
return tl::unexpected(ErrorCode::INVALID_PARAMS); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check for local_hostname
consistency is redundant as it's already performed in Client::InitTransferEngine
. In the new setup
overload path, this condition will always be false, making it dead code for that path. To avoid code duplication and improve maintainability, this check can be removed from here. The check in Client::InitTransferEngine
is sufficient.
No description provided.