Skip to content

Conversation

hjchen2
Copy link
Contributor

@hjchen2 hjchen2 commented Sep 28, 2025

No description provided.

@hjchen2 hjchen2 changed the title pass transfer engine to mooncake store to reuse the engine to transfe… pass transfer engine to mooncake store to reuse the engine to transfer data Sep 28, 2025
@stmatengss
Copy link
Collaborator

Good thought. I have a similar idea but lack the time to implement it. Will review it ASAP.

@ykwd
Copy link
Collaborator

ykwd commented Sep 29, 2025

/gemini review

Copy link

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.

@ykwd
Copy link
Collaborator

ykwd commented Sep 29, 2025

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines 161 to 169
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);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants