turboFei commented on code in PR #3388:
URL: https://github.com/apache/celeborn/pull/3388#discussion_r2230385296


##########
common/src/main/java/org/apache/celeborn/common/network/util/NettyUtils.java:
##########
@@ -182,39 +176,42 @@ 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";
       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);
-        labels.put("allocatorIndex", String.valueOf(index));
+      if (conf.getCelebornConf().networkMemoryAllocatorAllowCache()) {
+        String poolName =
+            allowCache ? "celeborn-netty-shared-cache-pool" : 
"celeborn-netty-shared-pool";
+        labels.put(NETTY_POOL_LABEL, poolName);

Review Comment:
   addressed https://github.com/apache/celeborn/pull/3007#discussion_r1893437934
   
   @pan3793 This PR would not cause grafana dashboard change



-- 
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]

Reply via email to