turboFei commented on code in PR #3388:
URL: https://github.com/apache/celeborn/pull/3388#discussion_r2230348538
##########
common/src/main/java/org/apache/celeborn/common/network/util/NettyUtils.java:
##########
@@ -182,34 +173,37 @@ public static ByteBufAllocator getByteBufAllocator(
public static ByteBufAllocator getByteBufAllocator(
TransportConf conf, AbstractSource source, boolean allowCache, int
coreNum) {
+ ByteBufAllocator allocator;
if (conf.getCelebornConf().networkShareMemoryAllocator()) {
- return getSharedByteBufAllocator(
- conf.getCelebornConf(),
- source,
- allowCache &&
conf.getCelebornConf().networkMemoryAllocatorAllowCache());
- }
- int arenas;
- if (coreNum != 0) {
- arenas = coreNum;
+ allocator =
+ getSharedByteBufAllocator(
+ conf.getCelebornConf(),
+ allowCache &&
conf.getCelebornConf().networkMemoryAllocatorAllowCache());
} else {
- arenas = conf.getCelebornConf().networkAllocatorArenas();
- }
- ByteBufAllocator allocator =
- createByteBufAllocator(
- conf.getCelebornConf().networkMemoryAllocatorPooled(),
- conf.preferDirectBufs(),
- allowCache,
- arenas);
- if (conf.getCelebornConf().networkMemoryAllocatorPooled()) {
- pooledByteBufAllocators.add((PooledByteBufAllocator) allocator);
+ int arenas;
+ if (coreNum != 0) {
+ arenas = coreNum;
+ } else {
+ arenas = conf.getCelebornConf().networkAllocatorArenas();
+ }
+ allocator =
+ createByteBufAllocator(
+ conf.getCelebornConf().networkMemoryAllocatorPooled(),
+ conf.preferDirectBufs(),
+ allowCache,
+ arenas);
+ if (conf.getCelebornConf().networkMemoryAllocatorPooled()) {
+ pooledByteBufAllocators.add((PooledByteBufAllocator) allocator);
+ }
}
if (source != null) {
- String poolName = "default-netty-pool";
+ String poolName;
Map<String, String> labels = new HashMap<>();
- String moduleName = conf.getModuleName();
- if (!moduleName.isEmpty()) {
- poolName = moduleName;
- int index = allocatorsIndex.compute(moduleName, (k, v) -> v == null ?
0 : v + 1);
+ if (conf.getCelebornConf().networkMemoryAllocatorAllowCache()) {
+ poolName = allowCache ? "celeborn-netty-shared-cache-pool" :
"celeborn-netty-shared-pool";
Review Comment:
addressed
https://github.com/apache/celeborn/pull/3007#discussion_r1893437934
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]