-
Notifications
You must be signed in to change notification settings - Fork 368
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
[CELEBORN-1814][CIP-14] Add transportMessage to cppClient #3042
Conversation
#include "celeborn/memory/ByteBuffer.h" | ||
#include "celeborn/proto/TransportMessagesCpp.pb.h" | ||
|
||
namespace celeborn { |
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.
Shall we consider use nested namespace? eg: namespace celeborn::proto::TransportMessage.
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.
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.
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.
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.
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.
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.
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.
Nested namespace added to TransportMessage.
#include "celeborn/memory/ByteBuffer.h" | ||
#include "celeborn/proto/TransportMessagesCpp.pb.h" | ||
|
||
namespace celeborn { |
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.
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.
cpp/celeborn/protocol/CMakeLists.txt
Outdated
@@ -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) |
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.
Although the default behavior for addlibrary
is STATIC, this part is inconsistent with other cmake files.
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.
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.
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.
LGTM
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.
LGTM. Thanks. Merged into main(v0.6.0).
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.