pan3793 commented on code in PR #3007:
URL: https://github.com/apache/celeborn/pull/3007#discussion_r1893437934
##########
common/src/main/java/org/apache/celeborn/common/network/util/NettyUtils.java:
##########
@@ -148,27 +139,29 @@ public static PooledByteBufAllocator
getPooledByteBufAllocator(
public static PooledByteBufAllocator getPooledByteBufAllocator(
TransportConf conf, AbstractSource source, boolean allowCache, int
coreNum) {
+ PooledByteBufAllocator allocator;
if (conf.getCelebornConf().networkShareMemoryAllocator()) {
- return getSharedPooledByteBufAllocator(
- conf.getCelebornConf(),
- source,
- allowCache &&
conf.getCelebornConf().networkMemoryAllocatorAllowCache());
- }
- int arenas;
- if (coreNum != 0) {
- arenas = coreNum;
+ allocator =
+ getSharedPooledByteBufAllocator(
+ conf.getCelebornConf(),
+ allowCache &&
conf.getCelebornConf().networkMemoryAllocatorAllowCache());
} else {
- arenas = conf.getCelebornConf().networkAllocatorArenas();
+ int arenas;
+ if (coreNum != 0) {
+ arenas = coreNum;
+ } else {
+ arenas = conf.getCelebornConf().networkAllocatorArenas();
+ }
+ allocator = createPooledByteBufAllocator(conf.preferDirectBufs(),
allowCache, arenas);
}
- PooledByteBufAllocator allocator =
- createPooledByteBufAllocator(conf.preferDirectBufs(), allowCache,
arenas);
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 ? "netty-shared-cache-pool" :
"netty-shared-non-cache-pool";
Review Comment:
given it also could be used on the client side, we'd better have `celeborn-`
prefix in the name to distinguish with netty pools created by other components
```suggestion
poolName = allowCache ? "celeborn-netty-shared-cache-pool" :
"celeborn-netty-shared-pool";
```
--
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]