Skip to content
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

[CELEBORN-1814][CIP-14] Add transportMessage to cppClient #3042

Conversation

HolyLow
Copy link
Contributor

@HolyLow HolyLow commented Dec 31, 2024

What changes were proposed in this pull request?

Add transportMessage to cppClient.

Why are the changes needed?

TransportMessage is the building block of controlMessages.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Compilation and UTs.

@HolyLow
Copy link
Contributor Author

HolyLow commented Dec 31, 2024

@FMX @RexXiong Could you kindly help review this PR? Thanks a lot.
Any suggestion is welcome.

#include "celeborn/memory/ByteBuffer.h"
#include "celeborn/proto/TransportMessagesCpp.pb.h"

namespace celeborn {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we consider use nested namespace? eg: namespace celeborn::proto::TransportMessage.

Copy link
Contributor Author

@HolyLow HolyLow Jan 2, 2025

Choose a reason for hiding this comment

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

I think nested namespace is not that necessary. The nested namespace is to avoid naming conflict within the celebornCpp project (as the celebornCpp project is already protected in namespace celeborn and won't conflict with other projects), which is unlikely to happen as the celebornCpp is only for client side and is not for too much complexity. In contrast, a flat celeborn namespace would make it easier to use.
Yet it is right that nested namespace would offer more symbol isolation, and if you insist, I could refactor the code of course. But should we refactor all the modules, including memory, utils, conf, etc?
Looking forward to your suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think nested namespace is not that necessary. The nested namespace is to avoid naming conflict within the celebornCpp project (as the celebornCpp project is already protected in namespace celeborn and won't conflict with other projects), which is unlikely to happen as the celebornCpp is only for client side and is not for too much complexity. In contrast, a flat celeborn namespace would make it easier to use. Yet it is right that nested namespace would offer more symbol isolation, and if you insist, I could refactor the code of course. But should we refactor all the modules, including memory, utils, conf, etc? Looking forward to your suggestions.

Personally I prefer nested namespaces. I believe that using nested namespaces can enhance the clarity and extensibility of our code for future development. Additionally, I've noticed that namespace::core is utilized in BaseConf.cpp, which used this approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

The nested namespace will be better for future extensions of this native part. We wanted to utilize the native capabilities for some parts of the worker.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nested namespace added to TransportMessage.

#include "celeborn/memory/ByteBuffer.h"
#include "celeborn/proto/TransportMessagesCpp.pb.h"

namespace celeborn {
Copy link
Contributor

Choose a reason for hiding this comment

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

The nested namespace will be better for future extensions of this native part. We wanted to utilize the native capabilities for some parts of the worker.

@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
add_library(protocol PartitionLocation.cpp)
add_library(protocol PartitionLocation.cpp TransportMessage.cpp)
Copy link
Contributor

Choose a reason for hiding this comment

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

Although the default behavior for addlibrary is STATIC, this part is inconsistent with other cmake files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems that only the proto module explicitly declares STATIC, and other modules don't declare it. So this is consistent to other modules. Yet adding the STATIC declaration brings no harm, so this cmakelist is refactored as requested.
We could refactor the makelists in the following commit to add the STATIC to all makelists.

@HolyLow
Copy link
Contributor Author

HolyLow commented Jan 3, 2025

@FMX @RexXiong The nested namespace and STATIC declaration is added to TransportMessage part. I will refactor other modules with nested namespace in the following commit rather than this commit to avoid polluting the commit message.

Any suggestion is welcome.

@RexXiong
Copy link
Contributor

RexXiong commented Jan 3, 2025

@FMX @RexXiong The nested namespace and STATIC declaration is added to TransportMessage part. I will refactor other modules with nested namespace in the following commit rather than this commit to avoid polluting the commit message.

Any suggestion is welcome.

Thanks for your efforts @HolyLow

Copy link
Contributor

@RexXiong RexXiong left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@FMX FMX left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks. Merged into main(v0.6.0).

@FMX FMX closed this in 8b096ea Jan 3, 2025
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