This is an automated email from the ASF dual-hosted git repository.

zuston pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/uniffle.git


The following commit(s) were added to refs/heads/master by this push:
     new 463732140 [#2730] improvement(common): Use built-in 
`CompositeFileRegion` and remove unnecessary `deallocate` method (#2731)
463732140 is described below

commit 4637321402dd09616e66065b600b97319dbeb144
Author: Zhen Wang <[email protected]>
AuthorDate: Mon Mar 2 10:54:24 2026 +0800

    [#2730] improvement(common): Use built-in `CompositeFileRegion` and remove 
unnecessary `deallocate` method (#2731)
    
    ### What changes were proposed in this pull request?
    
    + move `CompositeFileRegion` class to uniffle package
    + do nothing in deallocate method
    
    ### Why are the changes needed?
    
    Since we have already overridden the `release()/release(int decrement)` 
methods, we don't need to do anything in the `deallocate()` method. And after 
this, we no longer need to place it in the `io.netty.util` package.
    
    closes #2730
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
---
 .../common/netty/buffer/MultiFileSegmentManagedBuffer.java   |  3 ++-
 .../uniffle/common/netty/protocol}/CompositeFileRegion.java  | 12 ++----------
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git 
a/common/src/main/java/org/apache/uniffle/common/netty/buffer/MultiFileSegmentManagedBuffer.java
 
b/common/src/main/java/org/apache/uniffle/common/netty/buffer/MultiFileSegmentManagedBuffer.java
index 319f2ede8..797a2d72f 100644
--- 
a/common/src/main/java/org/apache/uniffle/common/netty/buffer/MultiFileSegmentManagedBuffer.java
+++ 
b/common/src/main/java/org/apache/uniffle/common/netty/buffer/MultiFileSegmentManagedBuffer.java
@@ -24,10 +24,11 @@ import java.util.List;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import io.netty.channel.FileRegion;
-import io.netty.util.CompositeFileRegion;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.uniffle.common.netty.protocol.CompositeFileRegion;
+
 /** A wrapper of multiple {@link FileSegmentManagedBuffer}, used for combine 
shuffle index files. */
 public class MultiFileSegmentManagedBuffer extends ManagedBuffer {
 
diff --git a/common/src/main/java/io/netty/util/CompositeFileRegion.java 
b/common/src/main/java/org/apache/uniffle/common/netty/protocol/CompositeFileRegion.java
similarity index 91%
rename from common/src/main/java/io/netty/util/CompositeFileRegion.java
rename to 
common/src/main/java/org/apache/uniffle/common/netty/protocol/CompositeFileRegion.java
index 4549ca0f2..bbebddbc1 100644
--- a/common/src/main/java/io/netty/util/CompositeFileRegion.java
+++ 
b/common/src/main/java/org/apache/uniffle/common/netty/protocol/CompositeFileRegion.java
@@ -15,15 +15,13 @@
  * limitations under the License.
  */
 
-package io.netty.util;
+package org.apache.uniffle.common.netty.protocol;
 
 import java.io.IOException;
 import java.nio.channels.WritableByteChannel;
 
 import io.netty.channel.FileRegion;
 
-import org.apache.uniffle.common.netty.protocol.AbstractFileRegion;
-
 public class CompositeFileRegion extends AbstractFileRegion {
   private final FileRegion[] regions;
   private long totalSize = 0;
@@ -114,13 +112,7 @@ public class CompositeFileRegion extends 
AbstractFileRegion {
   }
 
   @Override
-  protected void deallocate() {
-    for (FileRegion region : regions) {
-      if (region instanceof AbstractReferenceCounted) {
-        ((AbstractReferenceCounted) region).deallocate();
-      }
-    }
-  }
+  protected void deallocate() {}
 
   @Override
   public AbstractFileRegion touch() {

Reply via email to